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

Re: duplicates on primary key column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcin Gil <marcin(dot)gil(at)audax(dot)com(dot)pl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: duplicates on primary key column
Date: 2003-12-23 16:05:05
Message-ID: 4312.1072195505@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Marcin Gil <marcin(dot)gil(at)audax(dot)com(dot)pl> writes:
> I see. That's my first time with inheriting tables. I though that it 
> would be something as C++, ie. structure inherit only.

As of 7.4 there is a way to do structural inheritance, but it's not this
syntax.

>> You could do "SELECT docid FROM ONLY documents" if you don't want the
>> scan to include child tables.  But it's probably a bad idea to use
>> inheritance for the archives table at all.
>> 
> Why it's a bad idea?

Just because it's error prone.  I can't see that you'd ever want to
include the archives table in searches or updates of the documents table
--- but the default behavior will be to do so.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Marcin GilDate: 2003-12-23 16:29:23
Subject: Re: duplicates on primary key column
Previous:From: Marcin GilDate: 2003-12-23 15:52:11
Subject: Re: duplicates on primary key column

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