Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D838E632E12 for ; Tue, 9 Feb 2010 07:36:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 45147-02-2 for ; Tue, 9 Feb 2010 11:36:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f171.google.com (mail-qy0-f171.google.com [209.85.221.171]) by mail.postgresql.org (Postfix) with ESMTP id AA4356339D6 for ; Tue, 9 Feb 2010 07:34:11 -0400 (AST) Received: by qyk1 with SMTP id 1so2079739qyk.0 for ; Tue, 09 Feb 2010 03:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=oVYgp91wOBaPvWo5dlu3dWNNqe7MIzG9n+w6TUewJnM=; b=UJaqThqkOCH8npZ2ae6Xcna5XgDxTVb8ArwMhVkwCyU9ZAH2iVIjhqJXjPB24Svdzu R/dtr0Zt2ylbqjpDl473CnWW/Lmmc8w8f/UXeurhUouGS2AVvcuhLlieb+5uIc6viwzE BWCiDC6uyJqRT7Dl18phKe5cboy5pqurWqdU8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=cenUm5HPgN9pRwJD+XI6KQ6krRyI0hz7/5enzveylfGSGNWOYctxxAUfgfm0oX2Dzu 8jI1IggMHSvI4cEdAL9ZVOZsDmiPgkLDi6sRvNLR0miJ01oj/ZUPu3G6DD4xasqLQ5tc u8pk7jnvFidPqQAapDFNbLWaX3/tGanblG9NY= MIME-Version: 1.0 Received: by 10.229.100.226 with SMTP id z34mr1083511qcn.7.1265715250215; Tue, 09 Feb 2010 03:34:10 -0800 (PST) In-Reply-To: <20100209074909.GA11838@apartia.fr> References: <20100209074909.GA11838@apartia.fr> Date: Tue, 9 Feb 2010 09:34:10 -0200 Message-ID: <5ac667b81002090334u60d9f56dlf06af62e913da547@mail.gmail.com> Subject: Re: 'image' table with relationships to different objects From: Michael Lourant To: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/33 X-Sequence-Number: 33632 Hi There, Maybe a table MEDIA_OBJECT with a ID column that will be exported as FK to other tables and as many columns as media types you want to store or a single column where you'll store the bytes of your media file. Hope it works! __ Michael Lourant "Let's warm them all..." 2010/2/9 Louis-David Mitterrand : > Hello, > > In my database I have different object types (person, location, event, > etc.) all of which can have several images attached. > > What is the best way to manage a single 'image' table with relationships > to (potentially) many different object types while keeping referrential > integrity (foreign keys)? > > Thanks, > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql >