Subject: | Producer::PostgreSQL |
I've coded my own Parser so that I can leverage all the
S::T Producers but encountered two problems using the
PostgreSQL output.
First, I assigned to "size" for a date field which
produced the output:
"DoB" date(8),
which is a syntax error in postgres. I can avoid this
easily enough.
Second, the schema I produced has mixed case names and
postgres is case sensitive. The name quoting in the CREATE
TABLE statements preserve my names but there are no quotes
in the foreign key definitions:
ALTER TABLE CGAS ADD FOREIGN KEY ("cod_id")
REFERENCES COD ("id");
ALTER TABLE: column "cod_id" referenced in foreign key
constraint does not exist
When I add the quotes, the alter succeeds:
ALTER TABLE "CGAS" ADD FOREIGN KEY ("cod_id")
REFERENCES "COD" ("id");
Thanks,
Brad
pmvers SQL::Translator
0.05
This is perl, v5.6.1 built for i386-linux
Debian Linux 2.4.19
psql (PostgreSQL) 7.2.1