On Jun 29, 2012, at 12:53 PM, Barry Steyn wrote:

> Hi Michael
> 
> I did read that recipe before I posted to this group. Unfortunately, single 
> table inheritance does not provide much advantage if the child table has 
> additional columns to the parent - with single table inheritance, one cannot 
> get to those additional child columns.
> 
> After reading up on concrete table inheritance, I am under the impression 
> that the only thing one needs to implement this is a extinguisher.  I could 
> be totally incorrect here. So the question is: Can I accomplish polymorphic 
> inheritance of postgres tables using the tableoid as a polymorphic_identity?

I'm not sure what you mean by "extinguisher" here.   As far as OID, SQLAlchemy 
would require that "oid" be present in the list of columns being selected, and 
that's all it needs.    So if adding Column("oid", Integer) produces "SELECT .. 
oid ..." and the value comes back, it can be used as a discriminator.   The 
discriminator can also be a SQL expression or function if that's what it needs 
to be.

I haven't worked with PG oids in many years since they've been deprecated (see 
http://www.postgresql.org/docs/8.4/interactive/runtime-config-compatible.html#GUC-DEFAULT-WITH-OIDS:
 "The use of OIDs in user tables is considered deprecated") and are disabled by 
default.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to