Hi Brian,
On Mon, 6 Aug 2007, Brian O'Connor wrote: > Hi, > > I'm trying to use pg_dump output with SQL::Translator and I keep running into > the same problem. I create a schema file, such as the attached file > wine_pg_dump.sql, using the "pg_dump -sx" command. When I try to run > SQL::Translator on this file I get the following error: > > sqlt -f PostgreSQL -t MySQL /tmp/wine_pg_dump.sql > wine_pg_dump.mysql > > > ERROR (line 198): Invalid field: Was expecting data type but found "$1" > FOREIGN KEY (vineyard_id) REFERENCES > vineyard(vineyard_id) ON DELETE CASCADE DEFERRABLE > INITIALLY DEFERRED;" instead > > ERROR (line 197): Invalid statement: Was expecting create, or comment on > table, or comment on column, or comment on other, or > comment, or alter, or grant, or revoke, or drop, or > insert, or connect, or update, or set > Error: translate: Error with parser 'SQL::Translator::Parser::PostgreSQL': > Parse failed. > > Lines 197 and 198 are: > > ALTER TABLE ONLY vineyard_wine > ADD CONSTRAINT "$1" FOREIGN KEY (vineyard_id) REFERENCES > vineyard(vineyard_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; > I suspect this is because the grammar for Postgres SQL parsing specifies \w for the names of tables, constraints etc, which does not include the character $. I can't seem to find documentation on the postgresql.org site that tells me which characters are allowed in names, anyone else see it anywhere? Is that some magical construct, or is it really the name of the constraint.. it's very strange looking.. ;) I'll fix this if someone can point out which characters Pg does allow. Jess PS 0.08 is the latest version, not the 0.08_X series. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ -- sqlfairy-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers
