|
From: Colin P. A. <co...@co...> - 2009-10-01 15:31:36
|
>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes:
Justin> On Wed, Sep 30, 2009 at 12:47 AM, Colin Paul Adams
Justin> <co...@co...> wrote:
>> The reason I say this, is because I tried switching from
>> sqlite3 to postgresql. It doesn't work there either. But this
>> time, instead of the column being of type "timestamp", it is of
>> type "timestamp without time zone", which is clearly wrong, as
>> CalendarTime includes timezone information.
>>
I looked into this yesterday and found pretty much the same thing. The
Justin> HaskellDB driver interface for database connections is too
Justin> ridig and doesn't allow you to specify the type you want
Justin> for a DateTime column, which in turn forces the driver
Justin> implementor to decide on a parsing strategy.
Justin> It's an unfortunate situation, but I'm glad you found a
Justin> workaround. If you feel like digging into the library to
Justin> improve the API I'd be glad to help.
After a bit of thought, i don't think an API change is needed for
this.
It is just the code to generate the SQL for CREATE TABLE is presumably
faulty. For CalendarTimeT columns it should generate a time of
timestamp with time zone
as CalendarTime is a zoned timestamp.
I have just checked with sqlite3 that a create table statement like
this works. Unfortunately I can't use the same bodge that I used with
postgresql, as ALTER TABLE in sqlite3 does not support changing column
types. But I'd like to experiment with changing the code generation
for this column type. Can you tell me which module this occurs in?
Of course, this will only work if all backends support this data type,
but my understanding is that this is a standard SQL type.
--
Colin Adams
Preston Lancashire
|