Re: Select For Update and Left Outer Join - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Select For Update and Left Outer Join
Date
Msg-id 4F418A62-BEB6-4D77-A0F1-B8DF27F211BF@nasby.net
Whole thread Raw
In response to Select For Update and Left Outer Join  (Patrick Earl <patearl@patearl.net>)
List pgsql-hackers
On May 1, 2011, at 12:27 PM, Patrick Earl wrote:
> In ORMs like NHibernate, there are a few strategies for mapping
> inheritance to SQL.  One of these is "Joined Subclass," which allows
> for the elimination of duplicate data and clean separation of class
> contents.
>
> With a class hierarchy such as this:
>
> Pet
> Dog : Pet
> Cat : Pet
>
> The query to get all the pets is as follows:
>
> select * from Pet
> left join Dog on Dog.Id = Pet.Id
> left join Cat on Cat.Id = Pet.Id

Since FOR UPDATE seems to be a dead end here...

Is that construct something that NHibernate natively understands? If so, could you use Postgres table inheritance
insteadof joins? 
--
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: FDW table hints
Next
From: Josh Berkus
Date:
Subject: Re: Extreme bloating of intarray GiST indexes