Nevermind, that got it.  Thanks mike for your ordinarily punctual
responses.

BTW, anyone have a need for a db schema comparison tool?  I thought
there was one out there, but I was dubious about the source.

cheers.
-chris

On Jun 20, 3:06 pm, percious <[EMAIL PROTECTED]> wrote:
> like this?
>
>     from sqlalchemy import MetaData, create_engine
>     metadata = MetaData()
>     engine = create_engine('postgres://[EMAIL PROTECTED]/Target')
>     connect = engine.connect()
>     connect.execute("setsearch_pathto 'my_db'")
>     metadata.reflect(bind=connect)
>
> (does not work)
>
> On Jun 20, 2:47 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> > its likely a connection specific thing.  do it on a Connection, then  
> > send that as "bind" to metadata.reflect().
>
> > On Jun 20, 2008, at 4:45 PM, percious wrote:
>
> > > Hey guys,
>
> > > I have a postgres database which requires me to "setsearch_pathto
> > > 'my_db'" before I can get a proper table listing.
>
> > > I have written a schema for this database, but what I would like to do
> > > is compare my schema against the existing database, and make sure that
> > > all my tables and columns jive.  I have tried something like this:
>
> > >    from sqlalchemy import MetaData, create_engine
> > >    metadata = MetaData()
> > >    engine = create_engine('postgres://[EMAIL PROTECTED]/Target')
> > >    engine.execute("setsearch_pathto 'my_db'")
> > >    metadata.bind = engine
> > >    metadata.reflect()
>
> > >   print metadata.tables.keys()
>
> > > which never returns the tables I desire.
>
> > > Does anyone have any pointers?
>
> > > Thanks,
> > > -chris
--~--~---------~--~----~------------~-------~--~----~
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