Hi Michael

Sorry, I meant *distuingisher* in my last response (not extuigisher). The
thing is, these are nore oids, they are tableoids. The difference (I think)
is that oids are row based, and tableoids are distinct for the table. So
every table has a unique tableoid. This is what I have been using. When I
query the parent, I keep on getting this reply for the child table:

sqlalchemy.exc.NoSuchColumnError: "Could not locate column in row for
> column 'banker.id'"
>

The setup is that Banker inhertits from Person. They both have an id as
primary key, and a name as a string, and the tableoid. Querying the tables
individually works perfectly along with the tableoid.

>From what I have read, this should really work. But I don't know why I am
getting that error above. I think this could solve the issue. Check out
tableoid, in the inheritance documentation, it says this: *In some cases
you might wish to know which table a particular row originated from. There
is a system column called tableoid in each table which can tell you the
originating table:*

As a fun aside: If you have postgres running, then do select A.tableoid
from A, and it will pop up, even though not explicitly specified on the
schema.

Michael, thank you for the great product. I don't know if I will ever get a
chance to thank you personally...

Barry



On Fri, Jun 29, 2012 at 1:50 PM, Michael Bayer <[email protected]>wrote:

>
> 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.
>
>

-- 
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