Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B1E289FB6EE for ; Tue, 24 Jul 2007 09:42:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 13725-07 for ; Tue, 24 Jul 2007 09:42:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sargon.lncsa.com (sargon.lncsa.com [212.99.8.251]) by postgresql.org (Postfix) with ESMTP id A0F139FB6DF for ; Tue, 24 Jul 2007 09:42:46 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by sargon.lncsa.com (Postfix) with ESMTP id 5A51A3057B1D for ; Tue, 24 Jul 2007 14:42:45 +0200 (CEST) Received: from sargon.lncsa.com ([127.0.0.1]) by localhost (sargon.lncsa.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id avyIX8oMkyIx for ; Tue, 24 Jul 2007 14:42:45 +0200 (CEST) Received: from zenon.apartia.fr (zenon.apartia.fr [10.0.3.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "zenon.apartia.fr", Issuer "ca.apartia.fr" (verified OK)) by sargon.lncsa.com (Postfix) with ESMTP id 3A77F3015E31 for ; Tue, 24 Jul 2007 14:42:45 +0200 (CEST) Received: from trajan.apartia.fr (trajan.apartia.fr [10.0.3.121]) by zenon.apartia.fr (Postfix) with ESMTP id B082BF0A253BF for ; Tue, 24 Jul 2007 14:42:44 +0200 (CEST) Received: by trajan.apartia.fr (Postfix, from userid 1000) id BBE042524368; Tue, 24 Jul 2007 14:42:46 +0200 (CEST) Date: Tue, 24 Jul 2007 14:42:46 +0200 From: Louis-David Mitterrand To: pgsql-sql@postgresql.org Subject: is there a 'table' data type in pg? Message-ID: <20070724124246.GA22602@apartia.fr> Mail-Followup-To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/138 X-Sequence-Number: 28873 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,