Re: Foreign key constraint question - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Foreign key constraint question
Date
Msg-id 20070722153544.GC2460@alvh.no-ip.org
Whole thread Raw
In response to Re: Foreign key constraint question  (Nis Jørgensen <nis@superlativ.dk>)
Responses Re: Foreign key constraint question  (Perry Smith <pedz@easesoftware.com>)
List 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.

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: shp2pgsql Help with sintax!
Next
From: Tom Lane
Date:
Subject: Re: Difference between PRIMARY KEY index and UNIQUE-NOT NULL index