Re: Column rename in an extension update script

From: Philippe BEAUDOIN <phb(dot)emaj(at)free(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column rename in an extension update script
Date: 2017-05-03 17:36:58
Message-ID: bc6f67dc-65e4-bb00-ebb1-f98c290cf4ad@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Le 03/05/2017 à 19:29, Tom Lane a écrit :
> Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
>> On 04/30/2017 11:54 PM, Philippe BEAUDOIN wrote:
>>> Just after the ALTER TABLE statement, I want to access this table. But
>>> at this time, the altered column is not visible with its new name.
>> From the error it looks to me like the statements are each run in a
>> separate session and the UPDATE is not seeing the ALTER TABLE.
> No, it's in the same session; the problem is the lack of a
> CommandCounterIncrement call between the ALTER's update and the parsing
> of the next statement. That means the update isn't visible yet,
> even in its own session. See the fix here:
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=9209e07605afe0349660447f20d83ef165cdd0ae
>
> regards, tom lane
Thanks Tom for the fix. And thanks to Julien and Adrian too, for the
time spent on this issue.

Regards.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2017-05-03 21:20:47 Re: Compatibility of libpg
Previous Message Tom Lane 2017-05-03 17:29:57 Re: Column rename in an extension update script

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-03 17:40:00 Re: password_encryption, default and 'plain' support
Previous Message David Fetter 2017-05-03 17:35:29 Re: renaming "transaction log"