Re: PGUSER and initdb

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: PGUSER and initdb
Дата
Msg-id 8042e8d3-5528-c328-393f-218420aad4f5@aklaver.com
обсуждение исходный текст
Ответ на Re: PGUSER and initdb  (Олег Самойлов <splarv@ya.ru>)
Ответы Re: PGUSER and initdb  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On 12/11/19 5:18 AM, Олег Самойлов wrote:
> 
>> This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see
Section33.14).
 
>> "
>>
>> https://www.postgresql.org/docs/12/libpq-envars.html
>> "
>> PGUSER behaves the same as the user connection parameter.
>> "
> 
> This is don't work with `initdb` and `pg_ctl initdb`.
> 

Hmm, yeah. So -U works but not the env variable. I would file a bug 
report(https://www.postgresql.org/account/login/?next=/account/submitbug/):

aklaver@tito:~> env | grep PGUSER
PGUSER=postgres

/usr/local/pgsql12/bin/initdb   -D pg_test_postgres/
/usr/local/pgsql12/bin/pg_ctl -D pg_test_postgres start

aklaver@tito:~> psql -d postgres -U postgres -p 5429
2019-12-11 08:25:22.334 PST [4978] FATAL:  role "postgres" does not exist
psql: error: could not connect to server: FATAL:  role "postgres" does 
not exist
aklaver@tito:~> psql -d postgres -U aklaver -p 5429
Null display is "NULL".
psql (12.1)
Type "help" for help.

postgres=# \du
                                    List of roles
  Role name |                         Attributes 
| Member of
-----------+------------------------------------------------------------+-----------
  aklaver   | Superuser, Create role, Create DB, Replication, Bypass RLS 
| {}


/usr/local/pgsql12/bin/initdb -U postgres  -D pg_test_postgres/

aklaver@tito:~> psql -d postgres -U postgres -p 5429
Null display is "NULL".
psql (12.1)
Type "help" for help.

postgres=# \du
                                    List of roles
  Role name |                         Attributes 
| Member of
-----------+------------------------------------------------------------+-----------
  postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS 
| {}



-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Logical Replication of Multiple Schema Versions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PGUSER and initdb