Re: Index file got removed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, sudalai <sudalait2(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Index file got removed
Date: 2016-11-23 18:50:19
Message-ID: 25687.1479927019@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> So I have explored in the code what would be the best way to fix the problem:
> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2016-11-23 22:05:58 Re: Index file got removed
Previous Message Tom Lane 2016-11-23 15:11:34 Re: Backend receive buffer get corrupted with string: NOTICE: table "cleanup_keys" does not exist, skipping