Re: Column rename in an extension update script
Philippe BEAUDOIN <phb.emaj@free.fr>
From: Philippe BEAUDOIN <phb.emaj@free.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>, Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Date: 2017-05-03T17:36:58Z
Lists: pgsql-hackers, pgsql-general
Le 03/05/2017 à 19:29, Tom Lane a écrit : > 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=9209e07605afe0349660447f20d83ef165cdd0ae > > regards, tom lane Thanks Tom for the fix. And thanks to Julien and Adrian too, for the time spent on this issue. Regards.
Commits
-
Ensure commands in extension scripts see the results of preceding DDL.
- 9209e07605af 10.0 landed
- d56b8b41b32b 9.6.3 landed
- d0d3a57bfa18 9.5.7 landed
- c9d6c564f4b1 9.2.21 landed
- c6b3d07061b8 9.4.12 landed
- 062824edd953 9.3.17 landed
-
Stamp 9.6.2.
- 6a18e4bc2d13 9.6.2 cited