Re: pg_dump with tables created in schemas created by extensions

From: Martín Marqués <martin(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_dump with tables created in schemas created by extensions
Date: 2016-08-23 19:46:42
Message-ID: CAPdiE1w=+4QeLCJ3ijJW1HcUaDZsto_tE5ipJ+hYrzUvZsy6gg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michael,

2016-08-23 5:02 GMT-03:00 Michael Paquier <michael(dot)paquier(at)gmail(dot)com>:
> On Sat, Aug 13, 2016 at 6:58 AM, Martín Marqués <martin(at)2ndquadrant(dot)com> wrote:
>> I believe the fix will be simple after the back and forth mails with
>> Michael, Stephen and Tom. I will work on that later, but preferred to
>> have the tests the show the problem which will also make testing the fix
>> easier.
>>
>> Thoughts?
>
> It seems to me that we are going to need a bit more coverage for more
> object types depending on the code paths that are being changed. For
> example, sequences or functions should be checked for as well, and not
> only tables. By the way, do you need help to build a patch or should I
> jump in?

I wanted to test what I had in mind with one object, and then see if
any replication is needed for other objects.

I was struggling the last days as what I was reading in my patched
pg_dump.c had to work as expected, and dump the tables not created by
the test_pg_dump extension but inside the schema
regress_pg_dump_schema.

Today I decided to go over the test I wrote, and found a bug there,
reason why I couldn't get a successful make check.

Here go 2 patches. One is a fix for the test I sent earlier. The other
is the proposed idea Tom had using the dump_contains that Stephan
committed on 9.6.

So far I've checked that it fixes the dumpable for Tables, but I think
it should work for all other objects as well, as all this patch does
is leave execution of checkExtensionMembership at the end of
selectDumpableNamespace, leaving the dump_contains untouched.

Checks pass ok.

I will add tests for sequence and functions as you mention and test again.

Then I'll check if other tests should be added as well.

--
Martín Marqués http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-New-tests-for-pg_dump-which-make-sure-that-tables-fr.patch text/x-patch 2.7 KB
0002-This-patch-fixes-a-bug-reported-against-pg_dump-and-.patch text/x-patch 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martín Marqués 2016-08-23 20:34:19 Re: pg_dump with tables created in schemas created by extensions
Previous Message Antonin Houska 2016-08-23 19:39:33 Re: Question about MVCC-unsafe commands