[PATCH] Fix pg_dump --no-tablespaces for the custom format

From: Christopher Baines <mail(at)cbaines(dot)net>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Fix pg_dump --no-tablespaces for the custom format
Date: 2020-05-15 20:30:26
Message-ID: 878shtndp9.fsf@cbaines.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hey,

So I'm new to poking around in the PostgreSQL code, so this is a bit of
a shot in the dark. I'm having some problems with pg_dump, and a
database with tablespaces. A couple of the tables are not in the default
tablespace, and I want to ignore this for the dump.

Looking at the pg_dump --help, there seems to be a perfect option for
this:

--no-tablespaces do not dump tablespace assignments

This seems to work fine when using the plain text format, but I'm using
the custom format, and that seems to break the effect of
--no-tablespaces.

Looking at the code, I think I've managed to determine a place where
this behaviour can be changed, and so I've attached a draft patch [1].

Is this an actual problem, and if so, am I anywhere near the right place
in the code in terms of addressing it?

Thanks,

Chris

1:

Attachment Content-Type Size
0001-Fix-pg_dump-no-tablespaces-for-the-custom-format.patch text/x-patch 968 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2020-05-15 20:46:09 Support for NSS as a libpq TLS backend
Previous Message Pavel Stehule 2020-05-15 18:36:20 Re: calling procedures is slow and consumes extra much memory against calling function