pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guo, Yun <YGuo@cvent.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_dump not dumping some schemas
Date: Tue, 2 Jun 2015 13:41:39 +0000
Message-ID: <D19329C5.37A5E%yguo@cvent.com> (raw)
In-Reply-To: <11998.1433214088@sss.pgh.pa.us>
References: <D18CC6E9.36A0E%yguo@cvent.com>
	<A737B7A37273E048B164557ADEF4A58B36617951@ntex2010i.host.magwien.gv.at>
	<D18DE04B.36C72%yguo@cvent.com>
	<A737B7A37273E048B164557ADEF4A58B36618A43@ntex2010i.host.magwien.gv.at>
	<D191D463.3774F%yguo@cvent.com>
	<A737B7A37273E048B164557ADEF4A58B36618F30@ntex2010i.host.magwien.gv.at>
	<2DB6C5478F692C4C983B3129CC1AEB14CA65E8C8@HQ08HQMX002.cvent.net>
	<17196.1433168399@sss.pgh.pa.us>
	<D1928D1D.378F4%yguo@cvent.com>
	<11998.1433214088@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

InterestingŠ I checked the pg_depend for that schema, looks like it¹s
depending on an extension.

polling_etl=# SELECT classid, objid, refclassid, refobjid
FROM pg_depend
WHERE refclassid = 'pg_extension'::regclass
AND deptype = 'e'  and objid = 17972
ORDER BY 3,4;
 classid | objid | refclassid | refobjid
---------+-------+------------+----------
    2615 | 17972 |       3079 |    16730
		      ^^^^^^


polling_etl=# select * from pg_extension where oid = 16730;
 extname | extowner | extnamespace | extrelocatable | extversion |
extconfig | extcondition
---------+----------+--------------+----------------+------------+---------
--+--------------
 hstore  |       10 |        16389 | t              | 1.2        |
  |


How can I remove this dependency? Or what should I do to make it dump the
schema creation correctly?



On 6/1/15, 11:01 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

>"Guo, Yun" <YGuo@cvent.com> writes:
>> I tried gdb on selectDumpableNamespace() and dumpNamespace().
>> So it looks like for those problematic schemas,the dump value is 1 in
>> selectDumpableNamespace() which is correct, but when it goes to
>> dumpNamespace() the dump value becomes 0, so it get skipped.
>
>Oh really ...
>
>> Breakpoint 1, dumpNamespace (fout=0x654290, nspinfo=0x6600c0) at
>> pg_dump.c:7930
>> 7930	{
>> (gdb)  p nspinfo.dobj
>> $31 = {objType = DO_NAMESPACE, catId = {tableoid = 2615, oid = 17972},
>> dumpId = 13, name = 0x660d80 "test", namespace = 0x0,
>>   dump = 0 '\000', ext_member = 1 '\001', dependencies = 0x6e2b60,
>>nDeps = 1, allocDeps = 16}
>                     ^^^^^^^^^^^^^^
>
>There's the problem: this schema is marked as a member object of an
>extension, so it's not going to get dumped.  The expectation is that it'd
>be recreated during CREATE EXTENSION of whatever extension it belongs to.
>
>			regards, tom lane



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



view thread (19+ messages)  latest in thread

Message-ID: <D19329C5.37A5E%yguo@cvent.com>
Permalink:  ../D19329C5.37A5E%25yguo@cvent.com/
Also on:    postgresql.org/message-id/D19329C5.37A5E%yguo@cvent.com

 · 

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-admin@postgresql.org
  Cc: YGuo@cvent.com, tgl@sss.pgh.pa.us, laurenz.albe@wien.gv.at
  Subject: Re: pg_dump not dumping some schemas
  In-Reply-To: <D19329C5.37A5E%yguo@cvent.com>

* 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