Re: [HACKERS] psql: anyone ever notice?

2000-11-19 Thread Tom Lane

Vince Vielhaber [EMAIL PROTECTED] writes:
 $ psql -?
 psql: No match.

Odd --- I get the right thing:

$ psql -?
This is psql, the PostgreSQL interactive terminal.

Usage:
  psql [options] [dbname [username]]

Options:
  -a  Echo all input from script
  -A  Unaligned table output mode (-P format=unaligned)
[etc etc]

Something different about long-option handling on your platform, maybe?
What is your platform, anyway?

regards, tom lane



Re: [HACKERS] psql: anyone ever notice?

2000-11-19 Thread Dominic J. Eidson

On Sun, 19 Nov 2000, Tom Lane wrote:

 Vince Vielhaber [EMAIL PROTECTED] writes:
  $ psql -?
  psql: No match.
 
 Odd --- I get the right thing:
 
 $ psql -?
 This is psql, the PostgreSQL interactive terminal.

It has something to do with certain shell's expansion of ? - for the
longest time I'd have to do psql -\? to get it to work.


-- 
Dominic J. Eidson
"Baruk Khazad! Khazad ai-menu!" - Gimli
---
http://www.the-infinite.org/  http://www.the-infinite.org/~dominic/




Re: [HACKERS] psql: anyone ever notice?

2000-11-19 Thread Ross J. Reedstrom

It's a shell thing: Vince is running csh (or a derivative thereof)
while Tom (and I) are running some sort of  Bourne derived shell.

Vince, try:

psql -\?

Which works more universally.

Ross

On Sun, Nov 19, 2000 at 02:44:01PM -0500, Tom Lane wrote:
 Vince Vielhaber [EMAIL PROTECTED] writes:
  $ psql -?
  psql: No match.
 
 Odd --- I get the right thing:
 
 $ psql -?
 This is psql, the PostgreSQL interactive terminal.
 
-- 
Open source code is like a natural resource, it's the result of providing
food and sunshine to programmers, and then staying out of their way.
[...] [It] is not going away because it has utility for both the developers 
and users independent of economic motivations.  Jim Flynn, Sunnyvale, Calif.



[HACKERS] Final proposal for resolving C-vs-newC issue

2000-11-19 Thread Tom Lane

If you care about the nitty-gritty details, see
http://www.postgresql.org/cgi/cvsweb.cgi/pgsql/src/backend/utils/fmgr/README
particularly the final section "Telling the difference between old- and
new-style functions".

regards, tom lane



Re: [HACKERS] Final proposal for resolving C-vs-newC issue

2000-11-19 Thread Philip Warner

At 17:16 19/11/00 -0500, Tom Lane wrote:
If you care about the nitty-gritty details, see
http://www.postgresql.org/cgi/cvsweb.cgi/pgsql/src/backend/utils/fmgr/README
particularly the final section "Telling the difference between old- and
new-style functions".

There is no mention of the handling of toasted values for old C functions.
Does this mean that it is possible for crashes to occur after a dump/load +
updates?

Since I'd guess we will keep the old C style interface in perpetuity, since
it allows calling of arbitrary object libraries, I think it would be very
sensible to detoast all parameters prior to calling a 'raw'(?) function.
Perhaps, if this is too expensive, we can add a new attribute to prevent
detoasting if necessary, perhaps 'eatstoast' ;-).



Philip Warner| __---_
Albatross Consulting Pty. Ltd.   |/   -  \
(A.B.N. 75 008 659 498)  |  /(@)   __---_
Tel: (+61) 0500 83 82 81 | _  \
Fax: (+61) 0500 83 82 82 | ___ |
Http://www.rhyme.com.au  |/   \|
 |----
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



Re: [HACKERS] Final proposal for resolving C-vs-newC issue

2000-11-19 Thread Tom Lane

Philip Warner [EMAIL PROTECTED] writes:
 At 17:16 19/11/00 -0500, Tom Lane wrote:
 http://www.postgresql.org/cgi/cvsweb.cgi/pgsql/src/backend/utils/fmgr/README

 There is no mention of the handling of toasted values for old C functions.

Did you not read to the end?

: To allow old-style dynamic functions to work safely on toastable datatypes,
: the handler for old-style functions will automatically detoast toastable
: arguments before passing them to the old-style function.  A new-style
: function is expected to take care of toasted arguments by using the
: standard argument access macros defined above.

regards, tom lane



Re: [HACKERS] psql: anyone ever notice?

2000-11-19 Thread xuyifeng

all you guy unix?
under some shells, both * and ? are expanded to matched file names in current 
directory by shell,
for example FreeBSD's csh.

you should use psql -\? to get help screen, this sucks, 
"?" shouldn't be used as a help screen argument.

Regards,
XuYifeng

- Original Message - 
From: Vince Vielhaber [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 20, 2000 3:31 AM
Subject: [HACKERS] psql: anyone ever notice?


 
 $ psql -U
 psql: option requires an argument -- U
 Try -? for help.
 $ psql -?
 psql: No match.
 $
 
 Vince.
 -- 
 ==
 Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
  128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
 Online Campground Directoryhttp://www.camping-usa.com
Online Giftshop Superstorehttp://www.cloudninegifts.com
 ==
 
 
 
 



Re: [HACKERS] PG 7.1 pre-beta bug ...

2000-11-19 Thread Tom Lane

Don Baccus [EMAIL PROTECTED] writes:
 All went well except for a handful of occurances of the following error:
 ERROR:  SS_finalize_plan: plan shouldn't reference subplan's variable

This is probably my fault --- will look at it.

Appreciate the self-contained example...

regards, tom lane



[HACKERS] Re: [COMMITTERS] pgsql/src/backend/utils/adt (cash.c)

2000-11-19 Thread Thomas Lockhart

 Modify locale code to defend against possibility that it was compiled
 with an -fsigned-char/-funsigned-char setting opposite to that of libc,
 thus breaking the convention that 'undefined' values returned by
 localeconv() are represented by CHAR_MAX.  It is sheer stupidity that
 gcc even has such a switch --- it's just as bad as the structure-packing
 control switches offered by the more brain-dead PC compilers --- and
 as for the behavior of Linux distribution vendors who set RPM_OPT_FLAGS
 differently from the way they built libc, well, words fail me...

Which distros would these be? I know that Mandrake chooses some mutually
exclusive flags (-On and -fast-math) but am not sure which other ones
are inconsistant...

  - Thomas



[HACKERS] Table/Column Constraints

2000-11-19 Thread Christopher Kings-Lynne

Hi,

I was looking at the ALTER TABLE DROP CONSTRAINT bit of PostgreSQL, and I
started thinking about trying to implement it (as a bit of mental exercise).
(And because it's highly annoying not being able to remove the damn things!

Please comment on all of this, and tell me if it's going to be over my head!

I'm just trying to understand some stuff:

* I assume that the command is supposed to allow the dropping of unique,
primary, foreign key and check constraints?  Should 'not null' constraints
also be included here?

* Unique constraints are implemented as indicies, so dropping a unique
constraint maps to dropping the relevant index.

* Primary keys are implemented...how??  I can't for the life of me find
where 'create table' occurs in the source code!

* Foreign keys are implemented as two triggers?  It seems that all that is
required is the removal of these two triggers.  I haven't checked carefully
to see _exactly_ what the triggers are doing.  I see there is one associated
with the 'one' table and one with the 'many' table.  It seems that dropping
a foreign key constraint should be a case of removing the two triggers?

* Check constraints.  I seem to recall seeing code that implements check
constraints as triggers, but I wrote a query that retrieves all triggers
associated with a particular class and no check triggers were returned.  How
are check constraints implemented?  How would you drop a check constraint?

* Not null constraints.  This seems to be a 'for completeness' constraint -
I presume it's implemented as part of the attribute definition?  I guess it
would be relatively straightforward to drop a 'not null' constraint,
assuming they are actually named in there somewhere.

Would anyone be able to correct my understanding of these issues?

Also - is there some good reason why this hasn't been implemented yet?  Is
there some subtle reason, or is it just that no-one's bothered?

Thanks,

Chris




Re: [HACKERS] Final proposal for resolving C-vs-newC issue

2000-11-19 Thread Philip Warner

At 21:31 19/11/00 -0500, Tom Lane wrote:
Philip Warner [EMAIL PROTECTED] writes:
 At 17:16 19/11/00 -0500, Tom Lane wrote:

http://www.postgresql.org/cgi/cvsweb.cgi/pgsql/src/backend/utils/fmgr/README

 There is no mention of the handling of toasted values for old C functions.

Did you not read to the end?

'fraid not...8-(. Thanks.

: To allow old-style dynamic functions to work safely on toastable datatypes,
: the handler for old-style functions will automatically detoast toastable
: arguments before passing them to the old-style function.  A new-style
: function is expected to take care of toasted arguments by using the
: standard argument access macros defined above.


Philip Warner| __---_
Albatross Consulting Pty. Ltd.   |/   -  \
(A.B.N. 75 008 659 498)  |  /(@)   __---_
Tel: (+61) 0500 83 82 81 | _  \
Fax: (+61) 0500 83 82 82 | ___ |
Http://www.rhyme.com.au  |/   \|
 |----
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-19 Thread Vadim Mikheev

   Ok, so with CHECKPOINTS, we could move the offline log files to
   somewhere else so that we could archive them, in my
   undertstanding. Now question is, how we could recover from disaster
   like losing every table files except log files. Can we do this with
   WAL? If so, how can we do it?
  
  Not currently. WAL based BAR is required. I think there will be no BAR
  in 7.1, but it may be added in 7.1.X (no initdb will be required).
  Anyway BAR implementation is not in my plans. All in your hands, guys -:)
  
  Vadim
 
 Cam I ask what BAR is ?

Backup And Restore.

Vadim





Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-19 Thread Don Baccus

At 07:05 PM 11/19/00 +0100, [EMAIL PROTECTED] wrote:

Cam I ask what BAR is ?

Backup and recovery, presumably...



- Don Baccus, Portland OR [EMAIL PROTECTED]
  Nature photos, on-line guides, Pacific Northwest
  Rare Bird Alert Service and other goodies at
  http://donb.photo.net.