Re: VALID UNTIL

Lists: pgsql-hackers
From: Euler Taveira <euler(at)timbira(dot)com>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: VALID UNTIL
Date: 2012-03-14 14:20:05
Message-ID: 4F60A915.2010807@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I have a hard time figuring out why my replication stopped with a message like

FATAL: password authentication failed for user "foo"

in the logs. I thought it was some pg_hba.conf change, a pgpass modification,
or NOLOGIN option, it wasn't. I was out of options when I remembered to check
if there is a VALID OPTION option set. For my surprise, it wasn't exposed by
\du or even \du+.

euler=# \du
List of roles
-[ RECORD 1 ]----------------------------------------------
Role name | euler
Attributes | Superuser, Create role, Create DB, Replication
Member of | {}
-[ RECORD 2 ]----------------------------------------------
Role name | foo
Attributes |
Member of | {}

euler=# \du+
List of roles
-[ RECORD 1 ]-----------------------------------------------
Role name | euler
Attributes | Superuser, Create role, Create DB, Replication
Member of | {}
Description |
-[ RECORD 2 ]-----------------------------------------------
Role name | foo
Attributes |
Member of | {}
Description |

but after checking in the catalog I got it.

test=# select rolname,rolvaliduntil from pg_authid;
rolname | rolvaliduntil
---------+------------------------
euler |
foo | 2012-03-01 00:00:00-03
(2 rows)

Is there any reason why it is not exposed? What about exposing that
information in attributes or even in a separate column? It could help
troubleshooting quickly on this case.

--
Euler Taveira de Oliveira - Timbira http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


From: David Fetter <david(at)fetter(dot)org>
To: Euler Taveira <euler(at)timbira(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VALID UNTIL
Date: 2012-03-14 14:59:34
Message-ID: 20120314145934.GA13063@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Mar 14, 2012 at 11:20:05AM -0300, Euler Taveira de Oliveira wrote:
> Hi,
>
> I have a hard time figuring out why my replication stopped with a message like
>
> FATAL: password authentication failed for user "foo"
>
> in the logs. I thought it was some pg_hba.conf change, a pgpass modification,
> or NOLOGIN option, it wasn't. I was out of options when I remembered to check
> if there is a VALID OPTION option set. For my surprise, it wasn't exposed by
> \du or even \du+.
>
> Is there any reason why it is not exposed?

Oversight.

> What about exposing that information in attributes or even in a
> separate column? It could help troubleshooting quickly on this case.

I don't know how frequently people use VALID UNTIL, but I'm guessing
it's not terribly often because yours is the first comment about how
it's not exposed, so I'd tend toward putting it in attributes rather
than a separate column.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Euler Taveira <euler(at)timbira(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VALID UNTIL
Date: 2012-03-14 15:37:20
Message-ID: CAFcNs+q23nsTeA8d69cAHRxvpbgSsp_CdDtLuFfabZdAxyejww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2012/3/14 David Fetter <david(at)fetter(dot)org>

>
> I don't know how frequently people use VALID UNTIL, but I'm guessing
> it's not terribly often because yours is the first comment about how
> it's not exposed, so I'd tend toward putting it in attributes rather
> than a separate column.
>
>
If it's desired I can write a patch to put "Valid until" into attributes
column.

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Euler Taveira <euler(at)timbira(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VALID UNTIL
Date: 2012-03-14 22:56:16
Message-ID: CAFcNs+piQYqCkOy=YXstxca9G_zeOUwRmy-V_C8Dgk1-crS82A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2012/3/14 David Fetter <david(at)fetter(dot)org>

>
> I don't know how frequently people use VALID UNTIL, but I'm guessing
> it's not terribly often because yours is the first comment about how
> it's not exposed, so I'd tend toward putting it in attributes rather
> than a separate column.
>
>
The attached patch put VALID UNTIL into attributes column in verbose mode
like example above.

bdteste=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
bucardo | Superuser, Create role, Create DB, Replication | {}
postgres | Superuser, Create role, Create DB, Replication | {}

bdteste=# \du+
List of roles
Role name | Attributes
| Member of | Description
-----------+-------------------------------------------------------------------------------------------+-----------+--------------
bucardo | Superuser, Create role, Create DB, Valid until 2012-12-31
23:59:59.999999-02, Replication | {} | bucardo role
postgres | Superuser, Create role, Create DB, Replication
| {} |

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Attachment Content-Type Size
psql_describe_role_add_valid_until.patch text/x-patch 3.1 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fabriziomello(at)gmail(dot)com
Cc: David Fetter <david(at)fetter(dot)org>, Euler Taveira <euler(at)timbira(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VALID UNTIL
Date: 2012-03-15 00:21:00
Message-ID: 9616.1331770860@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
> The attached patch put VALID UNTIL into attributes column in verbose mode
> like example above.

Why would you confine it to verbose mode? For most people it won't
matter, but for people who are using the feature, it seems like
important information. Per the OP's complaint, it's particularly
important for those who have forgotten they're using the feature
(and hence would not think to specify "+" ...)

regards, tom lane


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, Euler Taveira <euler(at)timbira(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VALID UNTIL
Date: 2012-03-15 00:40:18
Message-ID: CAFcNs+qCG5h0+Wfx=CrudfYbk9HunNTLOiMTVWN5xhjNUcFPgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2012/3/14 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

>
> Why would you confine it to verbose mode?

Because I did not want to change the current behavior of this psql
command... but...

For most people it won't
> matter, but for people who are using the feature, it seems like
> important information. Per the OP's complaint, it's particularly
> important for those who have forgotten they're using the feature
> (and hence would not think to specify "+" ...)
>
>
You' re right, then I attached a new patch with your suggestion.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Attachment Content-Type Size
psql_describe_role_add_valid_until.patch text/x-patch 3.1 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fabriziomello(at)gmail(dot)com
Cc: David Fetter <david(at)fetter(dot)org>, Euler Taveira <euler(at)timbira(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VALID UNTIL
Date: 2012-03-22 06:09:34
Message-ID: 14522.1332396574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
> 2012/3/14 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> For most people it won't
>> matter, but for people who are using the feature, it seems like
>> important information. Per the OP's complaint, it's particularly
>> important for those who have forgotten they're using the feature
>> (and hence would not think to specify "+" ...)

> You' re right, then I attached a new patch with your suggestion.

Applied with minor corrections (mostly, ensuring the displayed text
is translatable).

regards, tom lane