[Catalyst] Postgresql database with non default -public- schema

Tamás Eisenberger tamas at eisenberger.hu
Wed Oct 20 15:38:24 GMT 2010


Hy!

I use DBIC's on_connect_do parameter to switch to the right pg schema like
this in the config:
<Model::Yourschema>
    <connect_info>
        dsn      dbi:Pg:host=3Dlocalhost;dbname=3Dyourdb
        user     youruser
        password yourpw
        pg_enable_utf8 1
        on_connect_do SET search_path TO yourschema
    </connect_info>
</Model::Yourschema>

2010/10/20 Het=E9nyi Csaba <csabiwork at tata.hu>

>  Dear All
>
> Please forgive me, may i must ask this question on DBIX maillist.
>
> I'd like to use "script/???_create.pl"  helper script to create
> model from a PostgreSql database.
> But my tables are not in the default Postgre tablespace (public).
>
> Is this helper script capable to automatically create model for
> the non-default tablespace?
>
> If i run the script the standard way:
>
> script/pcm_create.pl model DB DBIC::Schema Pcm::Schema create=3Dstatic
> components=3DTimeStamp,EncodedColumn 'dbi:Pg:dbname=3Dpcmv2;host=3Dxxx.xx'
> 'pcmuser' 'xxx' '{ AutoCommit =3D> 1 }'
>
> the script dumps schema without errors:
>
> ...
> Dumping manual schema for Pcm::Schema to directory
> /home/csabi/Dev/Pcm/script/../lib ...
> Schema dump completed.
> created "/home/csabi/Dev/Pcm/script/../lib/Pcm/Model/DB.pm"
> created "/home/csabi/Dev/Pcm/script/../t/model_DB.t"
>
> But when starting the application it says:
>
> ******************************* WARNING
> ***************************************
> * No sources found (did you forget to define your tables?)
>    *
> *
>   *
> * To turn off this warning, set the CMDS_NO_SOURCES environment variable.
>   *
>
> *************************************************************************=
******
>
> which is correct, because there is no tables in the default "public" pg
> schema.
> My tables are in the manually created "pcmbiz" schema.
>
> Thank You in advance!
>
> --
> Het=E9nyi Csaba
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101020/37f06=
2c6/attachment.htm


More information about the Catalyst mailing list