Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1ZDE-0008I2-LD for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Nov 2016 13:34:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c1ZDE-0001v3-84 for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Nov 2016 13:34:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1ZCa-0001Cr-JJ for pgsql-bugs@postgresql.org; Tue, 01 Nov 2016 13:34:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1ZCY-0002fA-3l for pgsql-bugs@postgresql.org; Tue, 01 Nov 2016 13:34:07 +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 uA1DY3U9016864; Tue, 1 Nov 2016 09:34:03 -0400 From: Tom Lane To: bashtanov@imap.cc cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14407: pg_attribute shows old column names for indexes In-reply-to: <20161101102226.15988.44326@wrigleys.postgresql.org> References: <20161101102226.15988.44326@wrigleys.postgresql.org> Comments: In-reply-to bashtanov@imap.cc message dated "Tue, 01 Nov 2016 10:22:26 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16862.1478007243.1@sss.pgh.pa.us> Date: Tue, 01 Nov 2016 09:34:03 -0400 Message-ID: <16863.1478007243@sss.pgh.pa.us> X-Pg-Spam-Score: -4.4 (----) 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 bashtanov@imap.cc writes: > create table tt(a int primary key); > alter table tt rename column a to b; > select attrelid::regclass, attname from pg_attribute where attrelid = > any('{tt,tt_pkey}'::regclass[]) and attnum > 0; This is not a bug; we don't attempt to rename index columns when changing the name of a heap column. It would create collision hazards and gain little. If you want to see what the columns of an index actually are, I suggest psql's \d command. In this example it produces regression=# \d tt_pkey Index "public.tt_pkey" Column | Type | Definition --------+---------+------------ a | integer | b primary key, btree, for table "public.tt" regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs