psql internal variables - Mailing list pgsql-general

From Thor Tall
Subject psql internal variables
Date
Msg-id 20060807125625.18394.qmail@web50314.mail.yahoo.com
Whole thread Raw
Responses Re: psql internal variables  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: could not open relation - why?
Next
From: "kevin.huang"
Date:
Subject: Re: does pgsql downloading mirror sites work?