From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Philippe BEAUDOIN <phb.emaj@free.fr>
Cc: pgsql-general@postgresql.org
Subject: Re: Column rename in an extension update script
Date: Wed, 03 May 2017 13:29:57 -0400
Message-ID: <649.1493832597@sss.pgh.pa.us> (raw)
In-Reply-To: <331e2430-9c74-ebeb-6e6c-e2257058bf92@aklaver.com>
References: <2cf7941e-4e41-7714-3de8-37b1a8f74dff@free.fr>
<331e2430-9c74-ebeb-6e6c-e2257058bf92@aklaver.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>
Adrian Klaver <adrian.klaver@aklaver.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=9209e07605afe0349660447f20d83ef16...
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, phb.emaj@free.fr
Subject: Re: Column rename in an extension update script
In-Reply-To: <649.1493832597@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox