Thanks, I'll look at that but it doesn't sound very concrete.
IE using a foreign key to see if somethings inherited.

Question 1
>From the sqlalchemy mapper configuration, PostGreSQLs version of
inheritence sounds like the "concrete" variary, as it automatically
joins the tables together with a select unless you use "FROM ONLY
table_name"
Concrete table inheritance : where each type of class is stored in its
own table
joined table inheritance : where the parent/child classes are stored
in their own tables that are joined together in a select
Can someone confirm which category postgresql falls into?

Question 2
Does the metadata.reflect stuff reflect inherited table definitions
from PostGreSQL?

Question 3
The inheritence i was refering to is present in postgresql

CREATE TABLE table1 (
col1,
col2
);

CREATE TABLE table2(
col2,
col3
) INHERITS table2;

I want to find out that :
* table2 is inherited from table1
* table2.col2 definition is from table1 and from table2 (postgres
merges them)
* table2.col1 definition comes from the inhertance of table1.col1
(much the same as the line above)

Does sqlalchemy support this distinction? Can i get the details from
somewhere?

On Apr 13, 9:54 pm, a...@svilendobrev.com wrote:
> > Is there a way of telling if a table is inherited from another
> > table and which tables it inherits from in the Metadata?
>
> inheritance is not really sql notion... so
>  a) look at the mapper.inherits (towards root) and/or
> mapper.polymorphic_itereator() (towards leafs)
>  b) see if table's primary key is foreign key to elsewhere, that may
> mean joined inheritance
>
> > Further to this, Is there a way of telling which column definitions
> > come from which table?
>
> thecolumn.table ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to