Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9clv-0002gp-1y for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Nov 2016 18:59:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c9clu-00060P-7P for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Nov 2016 18:59:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c9ccm-00051S-Jy for pgsql-bugs@postgresql.org; Wed, 23 Nov 2016 18:50:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c9cck-0005WM-36 for pgsql-bugs@postgresql.org; Wed, 23 Nov 2016 18:50:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uANIoJ1X025688; Wed, 23 Nov 2016 13:50:19 -0500 From: Tom Lane To: Michael Paquier cc: Julien Rouhaud , sudalai , PostgreSQL mailing lists Subject: Re: Index file got removed In-reply-to: References: <1479294998857-5930602.post@n3.nabble.com> <23523.1479317197@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Tue, 22 Nov 2016 21:57:29 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25686.1479927019.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Nov 2016 13:50:19 -0500 Message-ID: <25687.1479927019@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Michael Paquier writes: > So I have explored in the code what would be the best way to fix the prob= lem: > 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 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs