it would be an empty PrimaryKeyConstraint. It serves as the
"primary_key" column collection on the table object.
if it shows up in CREATE TABLE thats a bug though.
On Nov 5, 2009, at 5:05 PM, Wolodja Wentland wrote:
> Hi all,
>
> i just want to verify my observation that SA (svn trunk) includes a
> PrimaryKeyConstraint for every table even if there is no PK constraint
> in the database. Is this correct?
>
> --- snip ---
> $ psql wp_sw_20091030
> psql (8.4.1)
> SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
> Type "help" for help.
>
> wp_sw_20091030=# \d externallinks
> Table "public.externallinks"
> Column | Type | Modifiers
> ----------+-------------------+--------------------
> el_from | integer | not null default 0
> el_to | character varying | not null
> el_index | character varying | not null
>
> wp_sw_20091030=#
>
> ---
>>>> eng = create_engine('postgresql+psycopg2://
>>>> USER:passw...@localhost/wp_sw_20091030')
>>>> met = MetaData(bind=eng)
>>>> met.reflect()
>>>> el_t = met.tables['externallinks']
>>>> el_t.constraints
> set([PrimaryKeyConstraint()])
>>>> pk_con = el_t.primary_key
>>>> pk_con.name
>>>> pk_con.info
> {}
>>>> pk_con.columns.keys()
> []
> --- snip ---
>
> thanks
>
> Wolodja
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---