Skip site navigation (1) Skip section navigation (2)

Re: Support of INHERIT in existing tables (8.2+ releases)

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Support of INHERIT in existing tables (8.2+ releases)
Date: 2008-07-14 19:09:00
Message-ID: 487BA44C.4080907@lelarge.info (view raw or flat)
Thread:
Lists: pgadmin-hackers
Guillaume Lelarge a écrit :
> Dave Page a écrit :
>> On Fri, Jul 11, 2008 at 11:30 PM, Guillaume Lelarge
>> <guillaume(at)lelarge(dot)info> wrote:
>>
>>> So, here is a patch to add support on adding inherited tables on already
>>> existing tables. The feature is available since PostgreSQL 8.2 release.
>>>
>>> Tested on Linux. It works fine there. I didn't check Win32 platform 
>>> because
>>> I didn't change any xrc files :) Didn't check on Mac OS X either cause I
>>> don't have one (btw, I'm following ebay's Mac Mini list to get one 
>>> soon).
>>
>> Hmm, testing on 8.3.3 on Windows, I created parent and child table,
>> then tried to add parent to child's inherit list separately and got:
>>
>> ERROR:  syntax error at or near "from"
>> LINE 1: ALTER TABLE child ADD COLUMN id Inherited from table ...
>>
>> The actual SQL generated is:
>>
>> ALTER TABLE child ADD COLUMN id Inherited from table parent;
>> ALTER TABLE child INHERIT parent;
>>
>> Shouldn't it just be doing:
>>
>> ALTER TABLE child INHERIT parent;
>>
> 
> Yeah, you're right. I had this issue during my tests and I'm sure I 
> fixed it. Don't know why it isn't in the patch I sent. Sorry about this. 
> I can't check right now but I will take care of this issue this afternoon.
> 

This patch fixes the issue you found.

I have one question about inherited columns display in the table 
properties dialog. There's a "Inherited from" column on the Columns tab. 
It shows the word "inherited" when the column is inherited. But I 
initialy thought it would show the table name of the inherited column. 
Is it a bug? (btw, I checked in 1.8.4, it works the same (or it bugs the 
same :) ))


-- 
Guillaume.
  http://www.postgresqlfr.org
  http://dalibo.com

Attachment: inherit82+.v2.patch
Description: text/x-patch (8.6 KB)

In response to

Responses

pgadmin-hackers by date

Next:From: Guillaume LelargeDate: 2008-07-14 19:17:23
Subject: Re: Dialogs review
Previous:From: Guillaume LelargeDate: 2008-07-14 08:49:05
Subject: Re: Support of INHERIT in existing tables (8.2+ releases)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group