You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by RobertCZ <ro...@robert.cz> on 2005/08/28 15:25:37 UTC

Recordset & Postgres 8 problem (and fix)

Hello,

  Recordset seems to have problem with Postgres 8, probably because of 
some changes in Postgres schema handling 7.4 -> 8.0 (because it works 
fine with 7.4 and older versions). The problem manifests itself with 
some 'no relation triggers found' (and then a lot of 'command ignored' 
errors). It's because DBI->tables() returns tables from all schemas. 
Quick fix is to add to Compat

sub ListTablesPg8

    {
    my $hdl   = shift ;

    return $hdl -> tables( undef, 'public' ) ;
    }

and

%Compat =
...

'Pg' =>
...
      'ListTables'     => \&ListTablesPg8,


- Robert


PS DBI docs says

@names = $dbh->tables( $catalog, $schema, $table, $type );
@names = $dbh->tables;        # deprecated


so maybe default ListTables method should be modified instead, but then 
whole Recordset should be made schema-aware first I guess - should 
somebody have a bit of free time... ;-)




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Recordset & Postgres 8 problem (and fix)

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> 
>   Recordset seems to have problem with Postgres 8, probably 
> because of some changes in Postgres schema handling 7.4 -> 
> 8.0 (because it works fine with 7.4 and older versions). The 
> problem manifests itself with some 'no relation triggers 
> found' (and then a lot of 'command ignored' 
> errors). It's because DBI->tables() returns tables from all schemas. 
> Quick fix is to add to Compat
> 

Thanks for the patch. It will be in the next release of DBIx::Recordset

Gerald


> sub ListTablesPg8
> 
>     {
>     my $hdl   = shift ;
> 
>     return $hdl -> tables( undef, 'public' ) ;
>     }
> 
> and
> 
> %Compat =
> ...
> 
> 'Pg' =>
> ...
>       'ListTables'     => \&ListTablesPg8,
> 
> 
> - Robert
> 
> 
> PS DBI docs says
> 
> @names = $dbh->tables( $catalog, $schema, $table, $type );
> @names = $dbh->tables;        # deprecated
> 
> 
> so maybe default ListTables method should be modified 
> instead, but then whole Recordset should be made schema-aware 
> first I guess - should somebody have a bit of free time... ;-)
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org