Re: doing VALID UNTIL programmatically in SQL ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org, GNUmed list <Gnumed-devel(at)gnu(dot)org>
Subject: Re: doing VALID UNTIL programmatically in SQL ?
Date: 2003-06-11 13:32:05
Message-ID: 10495.1055338325@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jimmie H. Apsey 2003-06-11 13:41:08 Re: doing VALID UNTIL programmatically in SQL ?
Previous Message Jimmie H. Apsey 2003-06-11 13:30:21 Re: Multilple email being delivered