Re: ALTER USER - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: ALTER USER
Date
Msg-id 20030316163737.GA2214@dcc.uchile.cl
Whole thread Raw
In response to Re: ALTER USER  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: ALTER USER
List pgsql-hackers
On Sun, Mar 16, 2003 at 07:37:26AM -0600, Bruno Wolff III wrote:
> On Sat, Mar 15, 2003 at 22:38:13 -0400,
>   Alvaro Herrera <alvherre@dcc.uchile.cl> wrote:
> > Hackers,
> > 
> > One can alter a user to set a validity timestamp.  However, unless one
> > uses the ugly kludge of setting a date very far into the future, there's
> > no way to set this validity forever.
> 
> There is an infinite time for timestamp. There currently isn't for date,
> though there was some talk about doing that.

I don't know much about date/time datatypes, but valuntil is of type
abstime, and you can set it to infinity:

alvh=# alter user alvh valid until 'infinity';
ALTER USER
alvh=# select usename, valuntil from pg_shadow where usename='alvh';usename | valuntil
---------+----------alvh    | infinity
(1 row)


I see now that one can use this syntax to make a user valid forever,
though it is different than setting the value to NULL (as is when the
user hasn't got a validity defined).  This should be mentioned in the
docs, I think.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"In fact, the basic problem with Perl 5's subroutines is that they're not
crufty enough, so the cruft leaks out into user-defined code instead, by
the Conservation of Cruft Principle."  (Larry Wall, Apocalypse 6)


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Error message style guide
Next
From: Rod Taylor
Date:
Subject: Re: ALTER USER