Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2019 17:32:24 +1030
From:      Shane Ambler <FreeBSD@ShaneWare.Biz>
To:        David Newman <dnewman@networktest.com>, freebsd-questions@freebsd.org
Subject:   Re: changing the PostgreSQL default user
Message-ID:  <c19769d3-d1f8-0158-9cfe-49a2100a66b1@ShaneWare.Biz>
In-Reply-To: <9fdcf15e-2f83-1cfd-1e04-cc08943485fa@networktest.com>
References:  <9fdcf15e-2f83-1cfd-1e04-cc08943485fa@networktest.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21/10/19 4:52 pm, David Newman wrote:
> Greetings.
> 
> FreeBSD recently changed its default version of PostgreSQL from 9.5 to 11.
> 
> However, attempts to run 'pg_upgrade' on the databases failed for me
> because my 9.5 install had a default user of 'pgsql' and version 11 goes
> with 'postgres' instead [1].
> 
> My hack was to edit /usr/local/etc/rc.d/postgresql, set postgresql_user

No need - configure it in /etc/rc.conf

Config variables used by any rc script can be set in rc.conf, not just
the *_enable variables.

For postgresql*-server that is
postgresql_enable
postgresql_data
postgresql_flags
postgresql_initdb_flags
postgresql_class
postgresql_profiles

In the postgresql rc file, you will find -

postgresql_user=${postgresql_user:-"postgres"}

the part inside ${} means if this variable has not been set use this
default value.

-- 
FreeBSD - the place to B...Sharing Data

Shane Ambler




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c19769d3-d1f8-0158-9cfe-49a2100a66b1>