pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Lourant <lourant@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: 'image' table with relationships to different objects
Date: Tue, 9 Feb 2010 09:34:10 -0200
Message-ID: <5ac667b81002090334u60d9f56dlf06af62e913da547@mail.gmail.com> (raw)
In-Reply-To: <20100209074909.GA11838@apartia.fr>
References: <20100209074909.GA11838@apartia.fr>

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 <vindex+lists-pgsql-sql@apartia.org>:
> 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
>



view thread (8+ messages)  latest in thread

Message-ID: <5ac667b81002090334u60d9f56dlf06af62e913da547@mail.gmail.com>
Permalink:  ../5ac667b81002090334u60d9f56dlf06af62e913da547@mail.gmail.com/
Also on:    postgresql.org/message-id/5ac667b81002090334u60d9f56dlf06af62e913da547@mail.gmail.com

 · 

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: lourant@gmail.com
  Subject: Re: 'image' table with relationships to different objects
  In-Reply-To: <5ac667b81002090334u60d9f56dlf06af62e913da547@mail.gmail.com>

* 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