Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, pgsql-hackers(at)postgresql(dot)org, Thom Brown <thombrown(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns
Date: 2010-01-23 18:45:11
Message-ID: A7739F610FB0BD89E310D85E@[172.26.14.62]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On 14. Januar 2010 16:04:17 +0900 KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
wrote:

> This patch adds:
>
> List *find_column_origin(Oid relOid, const char *colName)
>
> It returns the list of relation OIDs which originally defines the given
> column. In most cases, it returns a list with an element. But, if the
> column is inherited from multiple parent relations and merged during the
> inheritance tree, the returned list contains multiple OIDs.
> In this case, we have to forbid changing type and renaming to keep
> correctness of the table definition.

Here's a slightly edited version of this patch from reviewing, fixing the
following:

* Fix a compiler warning by passing a pointer to skey to
systable_beginscan() (it's an array already)

* Edit some comments

The patch works as expected (at least, i don't see any remaining issues).
I'm going to mark this ready for committer.

--
Thanks

Bernd

Attachment Content-Type Size
pg-fix-inherit-rename-type-review.patch application/octet-stream 9.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2010-01-23 19:16:38 Re: 8.5 vs. 9.0, Postgres vs. PostgreSQL
Previous Message David E. Wheeler 2010-01-23 18:35:53 Re: 8.5 vs. 9.0, Postgres vs. PostgreSQL