Re: pg_get_indexdef excludes tablespace info - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_get_indexdef excludes tablespace info
Date
Msg-id 28037.1194462892@sss.pgh.pa.us
Whole thread Raw
In response to pg_get_indexdef excludes tablespace info  ("Steven Flatt" <steven.flatt@gmail.com>)
List pgsql-bugs
"Steven Flatt" <steven.flatt@gmail.com> writes:
> Would this be considered a bug or is the tablespace info excluded for
> a particular reason?

It's intentional: pg_dump doesn't want it there.  In a pg_dump script
we want to do

    set default_tablespace = foo_space;

    create index foo_idx on foo using btree (a);

because that way the creation command doesn't fail completely if there's
no such tablespace in the target installation.

We could maybe teach pg_dump to strip the clause out of
pg_get_indexdef's output, but that seemed complicated and fragile.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Martin Pitt
Date:
Subject: Re: Test suite fails on alpha architecture
Next
From: Falk Hueffner
Date:
Subject: Re: Test suite fails on alpha architecture