Re: [Maypole] problem with maypole and postgresql, different schema than public

From: Stephen Quinney (stephen at jadevine.org.uk)
Date: Wed Sep 22 2004 - 08:57:35 BST


On Tue, Sep 21, 2004 at 06:36:55PM -0400, Perrin Harkins wrote:
> On Tue, 2004-09-21 at 10:16, Jochen Schroer wrote:
> > I have a problem with maypole and postgresql, because I don't know how
> > I can access tables in different schema than public.
>
> When I need to do this in a Class::DBI app, I just put this in my
> Class::DBI base class:
>
> __PACKAGE__->db_Main->do('SET search_path TO myschema, public');
>
> I think you can configure that permanently for specific users somehow as
> well.
>
> You can typically just pass a table name with a . in it as well. So, it
> looks like the problem here is caused by Class::DBI::Loader or the way
> Maypole interacts with it.

CDBI::Loader::Pg uses the tables() function provided by DBI (well
DBD::Pg implements it). The relevant line is in the _load_classes()
subroutine:

@tables = $dbh->tables(undef, "public", "", "table" , {noprefix => 1});

i.e. it is hard wiring the schema to be public, that is probably the
cause of the problem.

Stephen Quinney

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT