When I try to load the database metadata via reflection:

        engine = create_engine(...)
        metadata = MetaData()
        metadata.bind = engine
        metadata.reflect()

It successfully loads all the tables and columns present; however, it does
not appear to load the unique constraints as well.  For example, I have a
table called "uid" in the database that is described as follows (Postgres):

CREATE TABLE uid (
    userid bigint PRIMARY KEY DEFAULT nextval('userseq'),
    firstname character varying(255),
    initials character varying(255) UNIQUE,
    lastname character varying(255)
);

The psql \d uid output shows that the unique constraint is indeed there:

                                 Table "public.uid"
  Column   |          Type          |                   Modifiers

-----------+------------------------+---------------------------------------
--------
 userid    | bigint                 | not null default
nextval('userseq'::regclass)
 firstname | character varying(255) |
 initials  | character varying(255) |
 lastname  | character varying(255) |
Indexes:
    "uid_pkey" PRIMARY KEY, btree (userid)
    "uid_initials_key" UNIQUE, btree (initials)

Is the SQLAlchemy "reflect" command just not designed to pick up these
unique constraints, or is there something I am missing?

Thank you!
Orest


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to