pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tureba@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14650: pg_dump -c fails when 'public' schema doesn't exist
Date: Fri, 12 May 2017 18:18:01 +0000
Message-ID: <20170512181801.1795.47483@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14650
Logged by:          Arthur Nascimento
Email address:      tureba@gmail.com
PostgreSQL version: 9.6.3
Operating system:   Linux - CentOS 7
Description:        

Hi,

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'::...
                                                             ^
pg_dump: [archiver (db)] query was: SELECT n.tableoid, n.oid, n.nspname,
(SELECT rolname FROM pg_catalog.pg_roles WHERE oid = nspowner) AS rolname,
(SELECT pg_catalog.array_agg(acl) FROM (SELECT
pg_catalog.unnest(coalesce(n.nspacl,pg_catalog.acldefault('n',n.nspowner)))
AS acl EXCEPT SELECT
pg_catalog.unnest(coalesce(pip.initprivs,pg_catalog.acldefault('n',n.nspowner))))
as foo) as nspacl, (SELECT pg_catalog.array_agg(acl) FROM (SELECT
pg_catalog.unnest(coalesce(pip.initprivs,pg_catalog.acldefault('n',n.nspowner)))
AS acl EXCEPT SELECT
pg_catalog.unnest(coalesce(n.nspacl,pg_catalog.acldefault('n',n.nspowner))))
as foo) as rnspacl, NULL as initnspacl, NULL as initrnspacl FROM
pg_namespace n LEFT JOIN pg_init_privs pip ON (n.oid = pip.objoid AND
pip.classoid = 'pg_namespace'::regclass AND pip.objsubid = 0 AND pip.objoid
<> 'public'::regnamespace)


This seems to have started in commit 330b84d8c4

A quick workaround is to create a schema called 'public' again, but I did
not expect the pg_dump error.

Thanks,
Arthur.


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


view thread (7+ messages)  latest in thread

Message-ID: <20170512181801.1795.47483@wrigleys.postgresql.org>
Permalink:  ../20170512181801.1795.47483@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170512181801.1795.47483@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tureba@gmail.com
  Subject: Re: BUG #14650: pg_dump -c fails when 'public' schema doesn't exist
  In-Reply-To: <20170512181801.1795.47483@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox