Re: ALTER USER

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER USER
Date: 2003-03-16 16:37:37
Message-ID: 20030316163737.GA2214@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)dcc(dot)uchile(dot)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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2003-03-16 17:03:48 Re: ALTER USER
Previous Message Nick Piggin 2003-03-16 14:56:13 IO scheduler vs PostgreSQL performance measurement