Search Postgresql Archives

Re: currval = currval+1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



salah jubeh <s_jubeh@xxxxxxxxx> 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 INTO account_status_change_log (account_id, 
> account_status_id, status_change_date) 
>   VALUES (new.account_id, new.account_status_id, now());

You'd be far better off doing that with a trigger.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux