Re: [BUGS] BUG #14650: pg_dump -c fails when 'public' schema doesn't exist - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: [BUGS] BUG #14650: pg_dump -c fails when 'public' schema doesn't exist
Date
Msg-id CAB7nPqTYuKYS4R=GBqL7tCpN67DPDTNGuf6JcH-RH1_vpEEoLQ@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14650: pg_dump -c fails when 'public' schema doesn't exist  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] BUG #14650: pg_dump -c fails when 'public' schema doesn'texist  (Stephen Frost <sfrost@snowman.net>)
List pgsql-bugs
On Sat, May 13, 2017 at 3:22 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> tureba@gmail.com writes:
>> It seems that pg_dump -c fails when the database doesn't have a 'public'
>> schema. When using a clean database, then dropping (or renaming) the
>> 'public' schema, a subsequent pg_dump -c tells me:
>
>> $ pg_dump -c test
>> pg_dump: [archiver (db)] query failed: ERROR:  schema "public" does not exist
>> LINE 1: ...::regclass AND pip.objsubid = 0 AND pip.objoid <> 'public'::...
>>                                                              ^
>
>> This seems to have started in commit 330b84d8c4
>
> Yeah, this is not cool.  Stephen?

This is visibly an oversight of the recent commit 330b84d, which is
broken on its face because it does not check for the existence of this
schema. One simple fix would be to extend this query with a SELECT
CASE ... ELSE 0 FROM pg_namespace WHERE nspname = 'public' but that's
ugly.
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [BUGS] Postgres 9.6.3 pg_dump issue
Next
From: Andres Freund
Date:
Subject: Re: [BUGS] BUG #14530: Logical Decoding Slowness