Re: Using ALTER TABLESPACE in pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using ALTER TABLESPACE in pg_dump
Date: 2004-10-19 18:20:42
Message-ID: 17650.1098210042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> DEFINITION: CREATE TABLE fred ... %%tablespace%% ...
> TABLESPACE: ' TABLESPACE t'

> pg_restore would read these, and use the settings from the command line to
> either substitute an empty string or the TABLESPACE text for %%tablespace%%
> in the DEFINTION.

Nope. I can break that trivially, eg:

CREATE INDEX fooi ON foo (f1) WHERE upper(f1) < ' %%tablespace%%';

Not very probable, maybe, but you can't just do a blind sed-style
substitution.

There's also the nontrivial matter of how pg_dump would decide where to
insert the %%tablespace%% string into the CREATE INDEX command in the
first place. If we're going to add code to parse CREATE INDEX and
insert the tablespace in the correct place, meseems it'd be better to
insert it on the pg_restore side.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-10-19 18:31:55 Re: Time off
Previous Message Philip Warner 2004-10-19 18:06:00 Re: Using ALTER TABLESPACE in pg_dump