Re: [GENERAL] currval = currval+1

2011-06-01 Thread Tom Lane
salah jubeh writes: > I have some rules on the table and I have dropped them and everything went > fine. Rules are macros, and have the usual issues with multiple evaluations of multiply-referenced arguments. > CREATE OR REPLACE RULE status_change_ins AS > ON INSERT TO account DO INSERT

Re: [GENERAL] currval = currval+1

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 10:22 AM, salah jubeh wrote: > I have some rules on the table and I have dropped them and everything went > fine. the rule is as follow > > CREATE OR REPLACE RULE status_change_ins AS >     ON INSERT TO account  DO  INSERT INTO account_status_change_log > (account_id, accoun

Re: [GENERAL] currval = currval+1

2011-06-01 Thread salah jubeh
, new.account_status_id, now()); I do not know what is happing here, but this is a strange behavior. Regards From: Merlin Moncure To: salah jubeh Cc: pgsql-general@postgresql.org Sent: Wed, June 1, 2011 4:54:36 PM Subject: Re: [GENERAL] currval

Re: [GENERAL] currval = currval+1

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 9:27 AM, salah jubeh wrote: > I have the following SQL statements > > BEGIN; > -- account_id is a sequence > INSERT INTO account (name) VALUES ('test customer'||random()::text); > -- account_id is a foreign key > INSERT INTO account_detail (account_id,..)  VALUES ((SELEC

[GENERAL] currval = currval+1

2011-06-01 Thread salah jubeh
I have the following SQL statements BEGIN; -- account_id is a sequence INSERT INTO account (name) VALUES ('test customer'||random()::text); -- account_id is a foreign key INSERT INTO account_detail (account_id,..) VALUES ((SELECT * from currval('account_acccount_id_seq')), ); COMMIT;