Re: [HACKERS] More initdb follies

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] More initdb follies
Дата
Msg-id 29157.944703510@sss.pgh.pa.us
обсуждение исходный текст
Ответ на More initdb follies  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: [HACKERS] More initdb follies  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Multibyte in autoconf
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)