A fixed user id for the postgres user?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: A fixed user id for the postgres user?
Date: 2001-08-19 16:52:38
Message-ID: Pine.LNX.4.30.0108191838150.677-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We've had some problem reports that the current practice of initdb
assigning to the postgres user the same usesysid as the user id of the
Unix user running initdb has caused some clashes.

(Imagine this scenario: A few years ago you installed BluePants Linux
5.0, created a user for PostgreSQL, id 501, created a database. Later you
created a few real users, which get uids 502, 503, etc. Then you
pg_dumpall that database (which saves the sysid). Now you install
BluePants Linux 7.0 on a new box, create a new user for PostgreSQL, which
turns out to be 502, because foolishly you created a user for TheirSQL
first. So now you replay your pg_dumpall and you have two users with id
502. Boom.)

One idea to resolve this, by getting rid of the usesysid column in favour
of the oid column has fallen by the wayside (for some valid reasons), so
the problem remains. I think the simplest fix would be to assign a fixed
usesysid of 1. There still is the possibility of changing that with an
initdb option, as there always has been. (We could also ensure that
CREATE USER never assigns ids below, say, 10, so that if for who knows
what reason we decide to add more users into the bootstrap installation we
have some room.)

Comments?

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Padgett 2001-08-19 17:10:50 Re: Guide to PostgreSQL source tree
Previous Message Peter Eisentraut 2001-08-19 16:28:26 LIKE indexing