pg_dump ignore tablespaces

Started by Gavin M. Royover 18 years ago2 messages
#1Gavin M. Roy
gavinmroy@gmail.com

Recently I ran into an issue where restoring from pg_dump from one machine
to another with non-matching tablespaces. The primary issue is that index
creation will fail if the tablespace does not exist from the dump. I was
thinking to best solution for this would be a pg_dump option such as
--ignore-tablespaces which would not dump any tablespace related data. This
would benefit restoring a dump from one machine to another where there are
different disk or tablespace topologies.
If such a patch were presented and found to be acceptable code wise, would
it be a generally useful enough option to be included?

Gavin

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gavin M. Roy (#1)
Re: pg_dump ignore tablespaces

"Gavin M. Roy" <gavinmroy@gmail.com> writes:

Recently I ran into an issue where restoring from pg_dump from one machine
to another with non-matching tablespaces. The primary issue is that index
creation will fail if the tablespace does not exist from the dump. I was
thinking to best solution for this would be a pg_dump option such as
--ignore-tablespaces which would not dump any tablespace related data.

We have --no-owner, so --no-tablespace doesn't seem out of line.

It's a bit late for 8.3 but no objection to adding such a feature
for 8.4.

regards, tom lane