web2py / pydal

A pure Python Database Abstraction Layer
BSD 3-Clause "New" or "Revised" License
497 stars 138 forks source link

Feature Request: add feature to use Postgres "timestamp with time zone" data type #344

Open 62mkv opened 8 years ago

62mkv commented 8 years ago

Postgres has a data type "timestamp with timezone" 1

As far as I can see, pyDAL does not have support for this; is it possible to add it ?

gi0baro commented 8 years ago

@62mkv I think at the moment would be quite a mess to add another field type in pyDAL. Also because this will break the support on other dbms, kinda a "postgre" feature in pyDAL.

You would like to have it just to stop converting from-to utc when dealing with timestamps, or you have some use-cases for this feature?

62mkv commented 8 years ago

As I look into (what I believe is) SQL:2011 standart specification [1], I see this sentence in section "4.4.3.5 Datatime types":

TIMESTAMP and TIME may also be specified as being WITH TIME ZONE, in which case every value has associated with it a time zone displacement. In comparing values of a data type WITH TIME ZONE, the value of the time zone displacement is disregarded

So, this feature is not Postgre only [1] http://www.jtc1sc32.org/doc/N2151-2200/32N2153T-text_for_ballot-FDIS_9075-1.pdf

gi0baro commented 8 years ago

@62mkv ok, but still we have to build a list of the dbms that supports this, decide what to do with the other ones, deal with different formats.. I'm just warning you that this gonna take some time.