Skip Menu |

This queue is for tickets about the DBIx-Class-TimeStamp CPAN distribution.

Report information
The Basics
Id: 32542
Status: open
Priority: 0/
Queue: DBIx-Class-TimeStamp

People
Owner: jshirley+cpan [...] gmail.com
Requestors: jasonk [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



Subject: Missing support for some PostgreSQL date/time data types...
This regexp is a little too restrictive to use effectively with PostgreSQL: if ( $info->{data_type} =~ /^(datetime|date|timestamp)$/i ) { PostgreSQL has three primary date/time data types (timestamp, date, time) and allows you to further specify 'with time zone' or 'without time zone' for the timestamp and time types. 'With time zone' can also be abbreviated just 'tz' (giving timestamptz and timetz) So the regexp should probably be more along the lines of: /^(datetime|date|timestamp|time)(tz|with(out)?\s+time\s+zone)?$/i Although for maximum compatibility, it may be worthwhile to consider just: /(date|time)/
On Tue Jan 22 17:41:51 2008, JASONK wrote: Show quoted text
> This regexp is a little too restrictive to use effectively with
PostgreSQL: Show quoted text
> > if ( $info->{data_type} =~ /^(datetime|date|timestamp)$/i ) { > > PostgreSQL has three primary date/time data types (timestamp, date, > time) and allows you to further specify 'with time zone' or 'without > time zone' for the timestamp and time types. 'With time zone' can also > be abbreviated just 'tz' (giving timestamptz and timetz) > > So the regexp should probably be more along the lines of: > > /^(datetime|date|timestamp|time)(tz|with(out)?\s+time\s+zone)?$/i > > Although for maximum compatibility, it may be worthwhile to consider just: > > /(date|time)/
I took the cue there from DBIx::Class::InflateColumn::TimeStamp, since I do expect that to inflate/deflate. It would be better to check if there is an inflation method, rather than the content type. DBIC::InflateColumn::TimeStamp does: my $type = lc($info->{data_type}); $type = 'datetime' if ($type =~ /^timestamp/); if ($type eq 'datetime' || $type eq 'date') { So, not really any more restrictive than I see with ::TimeStamp, but I do see your point. I just need to keep both of these modules in sync or find some better way to do it. The timezone stuff should be handled in extra => { timezone => '...' } it seems (not 100% sure on that)
Show quoted text
> I took the cue there from DBIx::Class::InflateColumn::TimeStamp, since I > do expect that to inflate/deflate. >
I mean DBIx::Class::InflateColumn::DateTime... I'm a moron.