Re: pg_upgrade rebuild_tsvector_tables.sql includes child table columns

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade rebuild_tsvector_tables.sql includes child table columns
Date: 2013-11-19 20:02:20
Message-ID: 20131119200220.GU28149@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 13, 2013 at 03:27:14PM -0500, Peter Eisentraut wrote:
> When pg_upgrade generates a rebuild_tsvector_tables.sql script to
> rewrite tsvector columns, it includes ALTER TABLE commands for child
> tables that cannot be altered independently from their parents:
>
> psql:rebuild_tsvector_tables.sql:673: ERROR: cannot alter inherited column "xxx"
>
> This isn't a problem unless you run the script in single-transaction
> mode, because the commands will just fail and the work has already
> been done in the parent table.
>
> It's probably not worth fixing this, given that this only applies to
> upgrades from 8.3, but I wanted to get it into the archives. If we
> ever need to do something like this again, we should make it smarter.

Good catch. I have applied the attached patch to head so if we ever use
this code for more complex cases, it will work properly for child
tables. Thanks.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
pg_upgrade.diff text/x-diff 1.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2013-11-19 20:06:11 Re: additional json functionality
Previous Message Tom Lane 2013-11-19 20:01:07 Re: UNNEST with multiple args, and TABLE with multiple funcs