pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
To: pgsql-sql@postgresql.org
Subject: is there a 'table' data type in pg?
Date: Tue, 24 Jul 2007 14:42:46 +0200
Message-ID: <20070724124246.GA22602@apartia.fr> (raw)

Hello,

In my forum app a new post can be related to several types of objects: 
person, location, event, simple text subject, etc. so in my 'forum' 
table I plan to add an id_subject column which can contain a reference 
to any number of different tables (location, person, etc.). What I need 
to know is to _what_ table the id_subject belongs.

Can I use a another column to store the type of the id_subject (ie: the 
tabled it belongs to) ? Then I would be able to query that table for 
additional info to print alongside the forum posts.

Thanks for your insights,



view thread (4+ messages)  latest in thread

Message-ID: <20070724124246.GA22602@apartia.fr>
Permalink:  ../20070724124246.GA22602@apartia.fr/
Also on:    postgresql.org/message-id/20070724124246.GA22602@apartia.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vindex+lists-pgsql-sql@apartia.org
  Subject: Re: is there a 'table' data type in pg?
  In-Reply-To: <20070724124246.GA22602@apartia.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox