Re: Thoughts on how to avoid a massive integer update. - Mailing list pgsql-general

From David G. Johnston
Subject Re: Thoughts on how to avoid a massive integer update.
Date
Msg-id CAKFQuwYh5qfo752TxAu6SrwXB5zAd-N_p00CKJZ8+fKm0WsWAw@mail.gmail.com
Whole thread Raw
In response to Re: Thoughts on how to avoid a massive integer update.  (Rob Sargent <robjsargent@gmail.com>)
Responses Re: Thoughts on how to avoid a massive integer update.
List pgsql-general
On Fri, May 8, 2020 at 12:49 PM Rob Sargent <robjsargent@gmail.com> wrote:
Well as I said, I think you could add a column to info_table
alter table info_table add orig_id int;
update info_table set orig_id = info_table_sid;

update info_table set info_table_sid = 456 where info_table_sid = 456; 
 
huh? 

alter table data_table drop reference NOT SQL
alter table data_table make reference to info_table.orig_id NOT SQL

You don't seem to understand the requirement.  The data_table integer value must be changed - all you are doing is a convoluted column rename on the table holding the PK half of the relationship.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_basebackup cannot compress to STDOUNT
Next
From: Rob Sargent
Date:
Subject: Re: Thoughts on how to avoid a massive integer update.