Re: PostgreSQL 7.4.x/CDBI bug
[prev]
[thread]
[next]
[Date index for 2005/02/28]
Hi again:
Hi,
With help from Cees and the always handy debugger, I found the error here:
> package Foo;
>
> use strict;
> use warnings;
>
> use base 'Class::DBI::Pg';
> use DBD::Pg qw(:pg_types);
>
> __PACKAGE__->connection( "dbi:Pg:dbname=template1" );
> __PACKAGE__->table('foo');
> __PACKAGE__->columns( All => qw( id bar ) );
> __PACKAGE__->sequence( 'foo_id_seq' );
> __PACKAGE__->data_type( id => { pg_type => 'int4'} );
This should be:
__PACKAGE__->data_type( id => { pg_type => PG_INT4} );
If you use any constant, like above, nobody complains; there's no such
a thing as "incorrect pg_type", or maybe a default type is assigned,
but the conversion will not take place. Besides, the only place I have
found types listed is DBD::Pg itself, so you should look there to
define the type. _And_ always use strict and warnings to be warned of
stuff.
Good luck, and thanks again!
JJ
|
|
Re: PostgreSQL 7.4.x/CDBI bug
JJ Merelo 17:51 on 28 Feb 2005
|