Re: doing VALID UNTIL programmatically in SQL ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: doing VALID UNTIL programmatically in SQL ?
Дата
Msg-id 10495.1055338325@sss.pgh.pa.us
обсуждение исходный текст
Ответ на doing VALID UNTIL programmatically in SQL ?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
> I have tried but not found a way to tell the VALID UNTIL clause
> something like
>     now() + '6 months'::interval

CREATE USER, like pretty much all utility statements in Postgres,
won't do any expression evaluation --- the parameters have to be
simple literal constants.

The only workaround I can think of is to do the CREATE USER inside
a helper plpgsql function that does the time calculation and then
uses EXECUTE to run the command with the appropriate values plugged
in.  It seems unlikely that this is a cleaner solution than doing it
in the client code ...

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: RE : PostgreSQL coredump : Couldn't find any tables,
Следующее
От: "Jimmie H. Apsey"
Дата:
Сообщение: Re: Multilple email being delivered