| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера