psql internal variables

Поиск
Список
Период
Сортировка
От Thor Tall
Тема psql internal variables
Дата
Msg-id 20060807125625.18394.qmail@web50314.mail.yahoo.com
обсуждение исходный текст
Ответы Re: psql internal variables  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: could not open relation - why?
Следующее
От: "kevin.huang"
Дата:
Сообщение: Re: does pgsql downloading mirror sites work?