On Tue, Oct 07, 2008 at 05:16:39PM -0700, Steve Midgley wrote:
>
> I think the relationship tables method works pretty well but I have  
> another suggestion. You could store the Foreign table name within image  
> table as well as the Foreign key.
>
> |id|image_url|f_table|f_key
> |1 |url......|person |1234
> |2 |url2.....|event  |5678
>
> I think this is called a "polymorphic join" but I could be wrong about  
> that. I'd guess you could construct a rule or trigger to validate the  
> foreign key data on insert/update but that's out of my skill area.

Hi Steve,

So in your solution the f_table column is just text which needs to be 
validated by a custom trigger?

-- 
http://www.lesculturelles.net

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to