Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 20841
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: debolaz [...] gmail.com
Cc:
AdminCc:

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



Subject: Producer::PostgreSQL handles size incorrectly
SQL::Translator::Producer::PostgreSQL will always remove the size attribute from the produced SQL code if size is 0. This isn't correct behaviour, some column types such as timestamp accepts a size of 0 which in that particular case specifies how many fractional digits to include. The culprit is the following piece of code: if ( defined $size[0] && $size[0] > 0 ) { $field_def .= '(' . join( ',', @size ) . ')'; } Removing the $size[0] > 0 part of the check seems to make everything work as supposed to without any negative side-effects.
From: JROBINSON [...] cpan.org
On Fri Aug 04 03:13:22 2006, debolaz wrote: Show quoted text
> SQL::Translator::Producer::PostgreSQL will always remove the size > attribute from the produced SQL code if size is 0. This isn't correct > behaviour, some column types such as timestamp accepts a size of 0 > which in that particular case specifies how many fractional digits to > include. > > The culprit is the following piece of code: > > if ( defined $size[0] && $size[0] > 0 ) { > $field_def .= '(' . join( ',', @size ) . ')'; > } > > Removing the $size[0] > 0 part of the check seems to make everything > work as supposed to without any negative side-effects.
Fixed in CVS, thanks.