Re: [ADMIN] How to enforce the use of the sequence for serial columns ?

2006-12-14 Thread Marc Mamin
Trigger based solution where same trig can be used for any number of tables by changing the parameter. Will throw one of 2 exceptions on failure to use sequence for the insert. Many thanks, This seems to be the simplest solution, Marc ---(end of

Re: [ADMIN] Backup

2006-12-14 Thread Eduardo J. Ortega
Thanks for this hint, I'll try to do this. Is there any change you could send me your 02:00 AM script so that i use something *I know* is already working? Perhaps off the mailing list, since maybe not everyone will enjoy code on their mail. Thanks. On Wednesday 13 December 2006 06:21, Andy

Re: [ADMIN] How to enforce the use of the sequence for serial columns

2006-12-14 Thread Ben K.
create table mytable (myid serial primary key constraint mytable_myid_chk check (myid = currval('mytable_myid_seq'), mydata varchar(255), ...); I'd like to clarify that this will not be a full solution, since it will not allow update of the table unless nextval has been used in the same

Re: [ADMIN] How to enforce the use of the sequence for serial columns

2006-12-14 Thread Jerry Sievers
Ben K. [EMAIL PROTECTED] writes: create table mytable (myid serial primary key constraint mytable_myid_chk check (myid = currval('mytable_myid_seq'), mydata varchar(255), ...); I'd like to clarify that this will not be a full solution, since it will not allow update of the table unless

Re: [ADMIN] How to enforce the use of the sequence for serial columns

2006-12-14 Thread Marc Mamin
It's not a full solution anyway since it prevents any kind of update on the table due to check constraints firing even if target field not updated. Well, we can extend the check within the trigger: if (coalesce old.a=new.a -- Update OR new.a = currval(tg_argv[0] -- Insert ) then

[ADMIN] unsubscribe

2006-12-14 Thread Bill Hernandez
unsubscribe ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [ADMIN] Where to Get Version of PostgreSQL Installation

2006-12-14 Thread Marc G. Fournier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On Thursday, December 14, 2006 10:23:04 -0500 Lane Van Ingen [EMAIL PROTECTED] wrote: Can I tell what version of the server I am running FOR SURE by using the command ‘psql --version’ ?? I am running 8.0.? on Windows 2003. try: psql -c

[ADMIN] Change database system identifier in pg_control?

2006-12-14 Thread Joshua Colson
Hello everyone, I'm trying to change the SYSID in pg_control (at least I think that is where it is) due to a catastrophic backup system failure, combined with a timely administrative oops. Does anyone know how I might go about doing that? The back story, for those interested: We lost *all* of

Re: [ADMIN] Change database system identifier in pg_control?

2006-12-14 Thread Tom Lane
Joshua Colson [EMAIL PROTECTED] writes: So I thought I would try to change the SYSID to 4965793265546637307 and have another shot at it. I'm not a PG guru so please let me know, is there any chance that what I'm doing will be successful, or am I just wasting my time? You'd have to modify