Search Postgresql Archives

psql internal variables

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

 



Hi,

It looks as if psql has internal variables I am how
ever not able to get it to work in the way I want.

I need to store the current date and then delete all
elements from 3 tables based on the same date.

I tried to set the variable curtime:

set curtime now()

but I could not use it in a delete:

delete from table_a where ts_date < curtime;

If I just delete from table_a and then table_b and the
table_c I may risk deleting rows in table_b and
table_c which correspond to rows in table_a. (due to
the different times returned by now();
I would have used on delete cascade but I can not due
to the way that the data is generated for the tables.

Thanks for any help you may provide,
/Thor 



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[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