More initdb follies

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: hackers(at)postgresql(dot)org
Subject: More initdb follies
Date: 1999-12-09 00:18:37
Message-ID: Pine.LNX.4.20.9912090040450.389-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In my digging around in initdb, I came to the --username option, which
supposedly allows you to initialize the database system with another
username. Not a bad idea, really.

Obviously, you'd have to be root in that case, because you want to create
files in someone else's name. But if you are root, the backends will
refuse to execute, wisely so. So this option is totally broken.

I propose that I remove it, and that it instead be possible that you can
do

root# su -l postgres -c 'initdb ...'

if you are not a fan of logging in and out of user accounts during the
install process.

That would also remove a whole bunch of the username/id checking logic,
since you just use the user you're logged in as ($UID, $USER), and if the
backend doesn't like it, it will tell you. pg_id adieu.

Another question: Is there a reason why the system views in initdb are all
created with a CREATE TABLE and then with a CREATE RULE, instead of using
CREATE VIEW? Is that a left over from the time before there were views as
such?

Question 3: Is there a reason why the template1 database is vacuumed twice
in the process? Once before all the views are created (no analyze) and
once at the very end (with analyze).

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 1999-12-09 01:04:01 Re: [HACKERS] Multibyte in autoconf
Previous Message Peter Eisentraut 1999-12-09 00:18:20 Re: [HACKERS] Multibyte in autoconf