Re: Index file got removed - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Index file got removed
Date
Msg-id 25687.1479927019@sss.pgh.pa.us
Whole thread Raw
In response to Re: Index file got removed  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Index file got removed
List pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes:
> So I have explored in the code what would be the best way to fix the pro=
blem:
> 1) Append the correct tablespace to the SQL string of CREATE INDEX.
> Those command strings are stored in changedIndexDefs in tablecmds.c,
> and those get generated by pg_get_indexdef_string(), which can append
> a tablespace if it is *not* a default. Appending *pg_default* to it
> would be dangerous and it would have user-visible changes. OK _string
> is not directly SQL callable but any caller of this function would be
> impacted.

I think that this is the correct fix.  There aren't any other callers
in the core code, and even if some third party is calling it, it's
fairly hard to see what usage would be okay with a TABLESPACE clause
being appended some of the time but not all of the time.  Also, both
of the other proposed fixes seem like kluges to me.

I pushed a patch that fixes it that way but incorporates your regression
test cases.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backend receive buffer get corrupted with string: NOTICE: table "cleanup_keys" does not exist, skipping
Next
From: Michael Paquier
Date:
Subject: Re: Index file got removed