Re: [HACKERS] TODO item: make pg_shadow updates more robust

From: Maarten Boekhold <maartenb(at)dutepp2(dot)et(dot)tudelft(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] TODO item: make pg_shadow updates more robust
Date: 1998-08-03 07:13:31
Message-ID: Pine.SUN.3.91.980803091127.9713F-100000@dutepp2.et.tudelft.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2 Aug 1998, Tom Lane wrote:

> I learned the hard way last night that the postmaster's password
> authentication routines don't look at the pg_shadow table. They
> look at a separate file named pg_pwd, which certain backend operations
> will update from pg_shadow. (This is not documented in any user
> documentation that I could find; I had to burrow into
> src/backend/commands/user.c to discover it.)
>
> Unfortunately, if a clueless dbadmin (like me ;-)) tries to update
> password data with the obvious thing,
> update pg_shadow set passwd = 'xxxxx' where usename = 'yyyy';
> pg_pwd doesn't get fixed.

This might explain why my test with the perl-interface failed....

>
> A more drastic problem is that pg_dump believes it can save and
> restore pg_shadow data using "copy". Following an initdb and restore
> from a pg_dump -z script, pg_shadow will look just fine, but only
> the database admin will be listed in pg_pwd. This is likely to provoke
> some confusion, IMHO.
>
> As a short-term thing, the fact that you *must* set passwords with
> ALTER USER ought to be documented, preferably someplace where a
> dbadmin who's never heard of ALTER USER is likely to find it.

An 'ALTER USER user RENAME TO new-user' would also come in handy then...

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems |
| Department of Electrical Engineering |
| Computer Architecture and Digital Technique section |
| M(dot)Boekhold(at)et(dot)tudelft(dot)nl |
-----------------------------------------------------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Zeugswetter 1998-08-03 11:57:46 AW: [HACKERS] Dropping tables...
Previous Message The Hermit Hacker 1998-08-03 06:47:12 Re: [HACKERS] is this allowed here-- I am developing an interface to postgresql