Re: Problem with CDBI::Loader

[prev] [thread] [next] [Date index for 2004/06/30]

From: Gabriel Horner
Subject: Re: Problem with CDBI::Loader
Date: 04:23 on 30 Jun 2004
Hi Andreas,
  That problem has been reported on rt.cpan.org : http://rt.cpan.org/NoAuth/Bug.html?id=5476                                                                                                                                          
You'll probably also have a problem with your tables being returned as public.$tablename as
mentioned in the bug link.

To get around both these issues: I added the following lines at the beginning
of the for loop inside _load_class():

        #skip tables from pg_catalog database                                                                                                                                                                                         
        next if ($table =~/^pg_catalog/);
        #change the name so that Class::DBI::Pg can understand it                                                                                                                                                                     
        $table =~ s/^public\.//g;

Peace,
Gabriel

On Wed, Jun 23, 2004 at 12:48:18PM +0200, Andreas Fromm wrote:
> Hi,
> 
> just wanted to try out CDBI::Loader. I set up the simplest case using
> PostgerSQL 7.4.2 (Debian/testing) and the recent packages from CPAN.
> When running the script, it fails complaining:
> 
> pg_catalog.pg_aggregate has no primary key at
> /usr/local/share/perl/5.8.3/Class/DBI/Loader/Pg.pm line 22
> 
> It is the '$class->set_up_table($table);' call that is failing for
> pg_catalog.pg_aggregate.
> 
> Did something changed in CDBI or postgres tha was not taken into account
> for CDBI::Loader jet?
> 
> regards
> 
> Andreas Fromm
> 

        -- 
        my looovely website -- http://www.chwhat.com
BTW, IF chwhat.com goes down email me at gabriel.horner@xxxx.xx

Problem with CDBI::Loader
Andreas Fromm 10:48 on 23 Jun 2004

Re: Problem with CDBI::Loader
Gabriel Horner 04:23 on 30 Jun 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52