Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6yDY-00054S-EM for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Nov 2016 11:17:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c6yDX-0001me-Jf for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Nov 2016 11:17:27 +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 1c6yCs-0000Jh-8k for pgsql-bugs@postgresql.org; Wed, 16 Nov 2016 11:16:46 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6yCm-0006hO-0f for pgsql-bugs@postgresql.org; Wed, 16 Nov 2016 11:16:45 +0000 Received: from mben.nabble.com (unknown [162.253.133.72]) by mwork.nabble.com (Postfix) with ESMTP id E3EF66C1B5B06 for ; Wed, 16 Nov 2016 04:16:38 -0700 (MST) Date: Wed, 16 Nov 2016 04:16:38 -0700 (MST) From: sudalai To: pgsql-bugs@postgresql.org Message-ID: <1479294998857-5930602.post@n3.nabble.com> Subject: Index file got removed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) 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 Hi, Please look at a below sequence of SQL. set default_tablespace to ''; create table test(id int primary key, processid bigint not null , ruleid bigint not null ); create index on test (ruleid ); create index on test (processid ); set default_tablespace to tblsp; alter table test alter processid type bigint, alter processid drop not null; I am creating a table test and index for that table on default tablespace. Then i'm changing default_tablespace to some other tablespace. After that altering one of the index column. This alter operation moves the index to new default_tablespace, but index file is missing in new tablespace. So we can not access the table. ---- db=# select * from test; ERROR: could not open file "pg_tblspc/16703/PG_9.6_201608131/16385/16710": No such file or directory db=# \d+ test Table "public.test" Column | Type | Modifiers | Storage | Stats target | Description -----------+---------+-----------+---------+--------------+------------- id | integer | not null | plain | | processid | bigint | | plain | | ruleid | bigint | not null | plain | | Indexes: "test_pkey" PRIMARY KEY, btree (id) "test_processid_idx" btree (processid), tablespace "tblsp" "test_ruleid_idx" btree (ruleid) --- I tried it on 9.5.1 & 9.6.0, index got missed in both version. -sudalai ----- sudalai -- View this message in context: http://postgresql.nabble.com/Index-file-got-removed-tp5930602.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs