The following bug has been logged on the website:
Bug reference: 14407
Logged by: Alexey Bashtanov
Email address: bashtanov(at)imap(dot)cc
PostgreSQL version: 9.6.1
Operating system: Ubuntu Linux 14.04.4 LTS
Description:
STEPS TO REPRODUCE:
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;
EXPECTED:
attrelid | attname
----------+---------
tt | b
tt_pkey | b
RECEIVED:
attrelid | attname
----------+---------
tt | b
tt_pkey | a
reproduced on 9.4.9, 9.6.1 and master
Regards,
Alexey