[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnumed-devel] Re: [GENERAL] doing VALID UNTIL programmatically in SQL ?
From: |
Tom Lane |
Subject: |
[Gnumed-devel] Re: [GENERAL] doing VALID UNTIL programmatically in SQL ? |
Date: |
Wed, 11 Jun 2003 09:32:05 -0400 |
Karsten Hilbert <address@hidden> 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