On 08/10/2016 09:01 PM, Demitri Muna wrote:
Hi Mike,

I think I'm more perplexed than before. My search_path was correctly
set. I put a breakpoint in my code after all of my classes and
relationships are defined and after a call to configure_mappers().

that doesn't make sense because the stack trace you showed is during the configure_mappers() step.

I
also turned "echo" on. The output is below.  There are two confusing
things. "metadata.tables" is empty, which is confusing since the code
*does* insert things into the database, so it's not completely broken.
When I execute the SQL command below by hand that generated the
"sqlalchemy.exc.NoSuchTableError: server" error below, I get zero rows
if the search path is set to "public", but the table is found if the
search path includes the schema the table is in ("trillian"). I'm not
sure how to proceed.

Thanks,
Demitri

ipdb> dbc.metadata.reflect()
2016-08-10 19:55:42,491 INFO sqlalchemy.engine.base.Engine SELECT
relname FROM pg_class c WHERE relkind = 'r' AND 'trillian' = (select
nspname from pg_namespace n where n.oid = c.relnamespace)
2016-08-10 19:55:42,491 INFO sqlalchemy.engine.base.Engine {}
2016-08-10 19:55:42,494 INFO sqlalchemy.engine.base.Engine
            SELECT c.oid
            FROM pg_catalog.pg_class c
            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE (pg_catalog.pg_table_is_visible(c.oid))
            AND c.relname = %(table_name)s AND c.relkind in ('r', 'v',
'm', 'f')

2016-08-10 19:55:42,494 INFO sqlalchemy.engine.base.Engine
{'table_name': 'server'}
*** sqlalchemy.exc.NoSuchTableError: server
ipdb> dbc.metadata.tables
immutabledict({})
ipdb> dbc.metadata
MetaData(bind=Engine(postgresql://trillian_admin:***@localhost:5432/trilliandb))

this would suggest "dbc" above is not the same symbol as the "Base" you illustrated in your previous email.




--
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sqlalchemy+unsubscr...@googlegroups.com
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to