pudo / dataset

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.

Home Page:https://dataset.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TIMESTAMPTZ Datatype for PostgreSQL

nagabrahmam-mantha opened this issue · comments

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.

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?

assuming fixed.