how to upgrade with catalog change - Mailing list pgsql-admin

From ZongtianHou
Subject how to upgrade with catalog change
Date
Msg-id 6D98D845-DD56-43B7-A563-DCAFE61D655E@icloud.com
Whole thread Raw
Responses Re: how to upgrade with catalog change  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
Hi, everyone

I have a new version which merely add a new column (indnkeyatts int2) in pg_index and can not be upgraded
1. if I add this column in middle by altering pg_index add column and drop column in old version to match every column
positionin new version, then can not started with new version, because there is dropped column info in old heap tuple
headerand it is accessed by hardcoded macro like Anum_pg_index_indkeynatts which cause column mismatch. And this can
notbe handled by deleting and inserting data again because database will be obsolete once the original data is deleted. 
2. if this column is added to the end of pg_index( change macro in pg_index.h and pg_attribute.h), in this way I just
needto add the new column and will not break old tuple, however,it can not be inited, does this column have to be added
aftercolumn indnatts because fixed and variable length thing? 

is there a simple way to just add this column and upgrade? and how does you implement it in pg_upgrade?

Best Regards,
Zongtian


pgsql-admin by date:

Previous
From: Karen Jex
Date:
Subject: Re: Actual meaning from pg_stat_replication.sync_state potential vs. sync and the usage of synchronous_standby_names
Next
From: Tom Lane
Date:
Subject: Re: how to upgrade with catalog change