doing VALID UNTIL programmatically in SQL ?

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: GNUmed list <Gnumed-devel(at)gnu(dot)org>
Subject: doing VALID UNTIL programmatically in SQL ?
Date: 2003-06-11 12:59:53
Message-ID: 20030611145953.B692@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

in a psql script for GnuMed (www.gnumed.org) I am using a
snippet like the following for setting up predefined test
accounts:

CREATE USER "test-doc"
WITH PASSWORD 'test-doc'
IN GROUP "gm-doctors", "gm-public"
VALID UNTIL '2003-09-30'
;

I would like to constrain their validity to, say, six months. I
have tried but not found a way to tell the VALID UNTIL clause
something like

now() + '6 months'::interval

Anyone have a suggestion (short of calculating in the client at
runtime and substituting) on how to do this in plain SQL ?

Thanks a lot,

Karsten Hilbert, MD
GnuMed i18n coordinator
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Anderson Vianet SAO 2003-06-11 13:07:45 current date/time precision
Previous Message Paulo Jan 2003-06-11 12:21:00 Re: Index not being used in MAX function (7.2.3)