PGUSER and initdb

Олег Самойлов <[email protected]>
Newsgroups gmane.comp.db.postgresql.general
Message-ID <[email protected]>
PGUSER doesn't work with initdb and pg_ctl initdb. Lets explain, where this can be important. For instance in MacOS the most convenient way to manage PostgresQL is homebrew. 

To install PostgresQL:

brew install postgresql

To upgrade:

brew upgrade postgresql

this will upgrade soft and to upgrade DB 

brew postgresql-upgrade-database

The later command do: install previous version of PostgresQL, move postgresql dir to postgesql.old, run pg_upgrade and so on. Convenient.

But this command don't have option to define name of superuser. The only variant to set name off superuser is to use PGUSER environment variable. But PGUSER understand only pg_upgrade, but not initdb.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.