initdb --sysid does not work

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-bugs(at)postgreSQL(dot)org, "Marc Sherman" <msherman(at)projectile(dot)ca>, "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Subject: initdb --sysid does not work
Date: 2001-05-23 21:46:13
Message-ID: 18113.990654373@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

In 7.1 and current sources, trying to use initdb's --sysid option to set
the postgres superuser's sysid does not work correctly. pg_shadow is
set up with the correct username and usesysid, but about half of the
standard system objects are nonetheless created with the postgres user's
Unix sysid. Example:

$ id
uid=256(postgres) gid=20(users)
$ initdb -i 333
This database system will be initialized with username "postgres".
... etc etc ...
$ start postmaster...
$ psql template1
template1=# create user uid_256 with sysid 256;
CREATE USER
template1=# select * from pg_shadow;
usename | usesysid | usecreatedb | usetrace | usesuper | usecatupd | passwd |
valuntil
----------+----------+-------------+----------+----------+-----------+--------+-
---------
postgres | 333 | t | t | t | t | |
uid_256 | 256 | f | f | f | f | |
(2 rows)

template1=# \dS
List of relations
Name | Type | Owner
----------------+---------+----------
pg_aggregate | table | uid_256
pg_am | table | uid_256
pg_amop | table | uid_256
pg_amproc | table | uid_256
pg_attrdef | table | postgres
pg_attribute | table | postgres
pg_class | table | postgres
pg_database | table | postgres
pg_description | table | uid_256
pg_group | table | postgres
pg_index | table | uid_256
pg_indexes | view | postgres
pg_inherits | table | uid_256
pg_language | table | uid_256
pg_largeobject | table | uid_256
pg_listener | table | uid_256
etc

It looks to me like the ones that are the unwanted userid are the ones
that are created by "create" bootstrap commands (as opposed to being
forcibly inserted into the various tables after substitution of PGUID).
Probably, the bootstrap backend is using the result of geteuid() with
no idea that initdb thinks something different should happen.

This is breaking the Debian package, or at least causing it to behave
undesirably.

regards, tom lane

Browse pgsql-bugs by date

  From Date Subject
Next Message Panon, Paul-Andre 2001-05-24 00:03:14 SQL update statements are dying in the query planner
Previous Message Tomasz Wegrzanowski 2001-05-23 21:09:01 config.h name clash