I just started looking at sqlalchemy and came across something I find
puzzling. 

first the short version:
if I connect to a database using a superuser account then I can define
my tables using autoload=True just fine and forgien keys are found, if
however I connect with a normal account and use autoload=True, then no
forgien keys are found.  Assuming that this must be a permission issue
(I'm using postgres) I granted the users group all rights for the entire
database, but that still did not work.  What am I missing, how are
forgien keys discovered?

Long version:

I'm using postgres 8.13 on windows.  I cearted a database logged in as
the superuser with two tables with a single foreign key between them.

if i connect to the data base with:
engin =
create_engin('postgres://user=supersuer&password=password&dbname=foo')
mytable = Table('mytable', engin, autoload=True)
mytable.foreign_keys

I get the correct foreign key

If I use
engin=create_engin('postgres://user=normaluser&password=password&dbname=foo')
mytable = Table('mytable', engin, autoload=True)
mytable.foreign_keys
returns an empty list.

If I connect normally with a regular psycopg connection and do select *
from foo, the normal user is able to get the data just fine.  So my
question is, what do I need to do to allow a normal user to discover the
table relations?

Thanks for any and all help

Jose


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to