Re: Fix pg_upgrade to preserve datdba - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix pg_upgrade to preserve datdba
Date
Msg-id 388710.1616351698@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fix pg_upgrade to preserve datdba  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fix pg_upgrade to preserve datdba  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Fix pg_upgrade to preserve datdba  (Jan Wieck <jan@wi3ck.info>)
List pgsql-hackers
I wrote:
> Needs a little more work than that --- we should allow it to respond
> to the --no-owner switch, for example.  But I think likely we can do
> it where other object ownership is handled.  I'll look in a bit.

Actually ... said code already DOES do that, so now I'm confused.
I tried

regression=# create user joe;
CREATE ROLE
regression=# create database joe owner joe;
CREATE DATABASE
regression=# \q
$ pg_dump -Fc joe >joe.dump
$ pg_restore --create -f - joe.dump | more

and I see

--
-- Name: joe; Type: DATABASE; Schema: -; Owner: joe
--

CREATE DATABASE joe WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII' LOCALE = 'C';


ALTER DATABASE joe OWNER TO joe;

so at least in this case it's doing the right thing.  We need a bit
more detail about the context in which it's doing the wrong thing
for you.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: Built-in connection pooler
Next
From: Peter Eisentraut
Date:
Subject: Re: default result formats setting