Re: PostgreSQL 7.4.x/CDBI bug

[prev] [thread] [next] [Date index for 2005/02/28]

From: JJ Merelo
Subject: Re: PostgreSQL 7.4.x/CDBI bug
Date: 17:51 on 28 Feb 2005
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

PostgreSQL 7.4.x/CDBI bug
JJ Merelo 10:12 on 27 Feb 2005

Re: PostgreSQL 7.4.x/CDBI bug
Cees Hek 14:41 on 27 Feb 2005

Re: PostgreSQL 7.4.x/CDBI bug
JJ Merelo 22:19 on 27 Feb 2005

Re: PostgreSQL 7.4.x/CDBI bug
JJ Merelo 22:45 on 27 Feb 2005

Re: PostgreSQL 7.4.x/CDBI bug
Cees Hek 00:23 on 28 Feb 2005

Re: PostgreSQL 7.4.x/CDBI bug
JJ Merelo 17:51 on 28 Feb 2005

Generated at 17:56 on 01 Mar 2005 by mariachi v0.52