[Dbix-class] PostgreSQL & schema

Peter Rabbitson rabbit+dbic at rabbit.us
Wed Feb 27 15:13:52 GMT 2013


On Wed, Feb 27, 2013 at 10:04:34AM -0500, Diab Jerius wrote:
> I'm trying to organize database objects using schema.  My primary server
> backend is Postgres.  The DBIC Pg storage docs indicate that it supports
> schema, but there's not much information anywhere that I can find in the
> DBIC documentation as to how one specifies schema.
> 
> ...
>         
> The quoting looks a bit weird.  In any case, upon deployment (via
> $schema->deploy) the tables are created, but Postgres balks at the extra
> '.' in the constraint names:
> 
>         NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "pbk_hdrs_pkey" for table "pbk_hdrs"
>         DBIx::Class::Schema::deploy(): DBIx::Class::Schema::deploy(): DBI Exception: DBD::Pg::db do failed: ERROR:  syntax error at or near "."
>         LINE 4:   CONSTRAINT "acis"."pbk_ccds_filename_ccd_id" UNIQUE ("file...
>                                    ^ at lib/CXC/MSTDB/Deploy/ACIS/PBK/Deploy.pm line 51
>          (running "CREATE TABLE "acis"."pbk_ccds" (
>           "filename" text NOT NULL,
>           "ccd_id" integer NOT NULL,
>           CONSTRAINT "acis"."pbk_ccds_filename_ccd_id" UNIQUE ("filename", "ccd_id")
>         );
>         CREATE INDEX "acis"."pbk_ccds_idx_filename" on "acis"."pbk_ccds" ("filename");
>         
>         ") at lib/CXC/MSTDB/Deploy/ACIS/PBK/Deploy.pm line 51
>         DBIx::Class::Schema::deploy(): DBIx::Class::Schema::deploy(): DBI Exception: DBD::Pg::db do failed: ERROR:  syntax error at or near "."
>         LINE 1: ...LTER TABLE "acis"."pbk_ccds" ADD CONSTRAINT "acis"."pbk_ccds...
>                                                                      ^ at lib/CXC/MSTDB/Deploy/ACIS/PBK/Deploy.pm line 51
>          (running "ALTER TABLE "acis"."pbk_ccds" ADD CONSTRAINT "acis"."pbk_ccds_fk_filename" FOREIGN KEY ("filename")
>           REFERENCES "acis"."pbk_hdrs" ("filename") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
>         
>         ") at lib/CXC/MSTDB/Deploy/ACIS/PBK/Deploy.pm line 51
> 
> Am I going about this the wrong way?
> 

What are the versions of DBIx::Class and SQL::Translator you are using?

perl -MDBIx::Class\ 999
perl -MSQL::Translator\ 999

Cheers




More information about the DBIx-Class mailing list