Re: [HACKERS] More initdb follies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] More initdb follies
Date: 1999-12-09 01:38:30
Message-ID: 29157.944703510@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> 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,

Makes sense to me --- I was saying more or less the same thing, I think,
when I said that initdb should pay attention to the effective UID it's
run under *and nothing else* to determine the postgres user name/ID.
In particular, if you want to be able to run it via "su", it mustn't
assume that environment variables like LOGNAME or USER are set correctly
for the postgres user. If it needs the user name it should look it up
from the EUID.

> 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?

Probably, but it's before my time.

> 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).

I've wondered about that too. There are some comments in initdb
suggesting that other orderings might fail, but I wouldn't be surprised
if those are obsolete. Have you tried altering the procedure?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-12-09 01:46:50 Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)
Previous Message Tom Lane 1999-12-09 01:31:20 Re: [HACKERS] Multibyte in autoconf