TIMESTAMPTZ Datatype for PostgreSQL
nagabrahmam-mantha opened this issue · comments
nagabrahmam-mantha commented
Hi, How can I create a column with datatype of TIMESTAMPTZ (in PostgreSQL).
I tried using this:
table.create_column('datetime', db.types.TIMESTAMPTZ)
But its giving error:
AttributeError: 'Types' object has no attribute 'TIMESTAMPTZ'
What is the right way?
Thanks.
Friedrich Lindenberg commented
I don't have much experience with TIMESTAMPTZ, but judging from this SO answer you should be able to do this:
from sqlalchemy import DateTime
table.create_column('datetime', DateTime(timezone=True))
Can you confirm?
Friedrich Lindenberg commented
assuming fixed.