Re: Foreign key constraint question

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Nis Jørgensen <nis(at)superlativ(dot)dk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign key constraint question
Date: 2007-07-22 15:35:44
Message-ID: 20070722153544.GC2460@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nis Jørgensen wrote:
> Alvaro Herrera skrev:
> > Nis Jørgensen wrote:
> >
> >> What if, for instance, I want to render a list of shapes?
> >>
> >> To render the shape, I need to get its data, to get its data, I
> >> need to know what type it is. ISTM that the easiest way to achieve
> >> this is storing the type info at the "top" of the table hierarchy.
> >
> > Try adding "tableoid" to the list of columns retrieved. Even better,
> > cast that to regclass.
>
> This is if I use PG table inheritance, right?

Right, that was what I was thinking.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-07-22 17:20:08 Re: Difference between PRIMARY KEY index and UNIQUE-NOT NULL index
Previous Message Michael Fuhr 2007-07-22 13:58:22 Re: shp2pgsql Help with sintax!