Search Postgresql Archives

First-class Polymorphic joins?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It surprises me that no SQL database to my knowledge has polymorphic joins as a first-class feature.

A polymorphic join is where a fk contains not just an id but an indicator of which table it refers to. So you could have a "tags" table, that can attach tags to any of a variety of other tables. Rails handles this by including the table name as a string.

This seems a reasonable thing to want to do, and it seems that the database could handle it by combining the fields from the target tables in the result.

I also think migrations ought to be a first-class feature…

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux