Hi all,

I'm working with postgres and sqlalchemy, I found a strange behavior
(a bug?) of the reflection code,
take a look at this:

# ------------------------------------------------------------
import sqlalchemy as sa

engine = sa.create_engine('postgres://xxx:[EMAIL PROTECTED]/xxx')
metadata = sa.BoundMetaData(engine)
tbl1 = sa.Table('test', metadata, sa.Column('test', sa.Unicode(100)))
print tbl1.c['test'].type, type(tbl1.c['test'].type) is sa.Unicode
metadata.create_all()

metadata = sa.BoundMetaData(engine)
tbl2 = sa.Table('test', metadata, autoload=True)
print tbl2.c['test'].type, type(tbl2.c['test'].type) is sa.Unicode
# ------------------------------------------------------------

The output of this snippet is

# ---8<-----------------------------------------------------
Unicode() True
PGString(length=100) False
# --->8------------------------------------------------------

The reflection code doesn't recognize the Unicode type, same behavior
with

engine = sa.create_engine('sqlite:///')

thank you


--~--~---------~--~----~------------~-------~--~----~
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