Hi Aleksey, the grammar in SQLT::Parser::PostgresQL is quite incomplete. I had the same problem today with CREATE FUNCTION and was able to fix it. If you send me your schema file (as test case), I will try to fix your problems too and - if successful - will submit a patch to this list.
Herbert m...@herbert-leitz.de On Wed, Jul 14, 2010 at 5:48 PM, Aleksey Tsalolikhin <atsaloli.t...@gmail.com> wrote: > Hi. I just installed SQL::Translator from CPAN to make a pretty > Entity Relationship diagram of our PostgreSQL schema, but when I run > sqlt-graph, I get errors on "ALTER FUNCTION" and "COMMENT ON FUNCTION" > in the schema. > > sqlt-graph also errors out on "ALTER AGGREGATE" and "COMMENT ON AGGREGATE". > > > For example: > > ERROR (line 28): 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, or select, or > copy, or readin symbol, or commit > Error: translate: Error with parser > 'SQL::Translator::Parser::PostgreSQL': Parse failed. > > Line 28: ALTER FUNCTION public.comma_cat(text, text) OWNER TO myuser; > > If I delete that line, and run sqlt-graph again, I get: > > ERROR (line 33): 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, or select, or > copy, or readin symbol, or commit > Error: translate: Error with parser > 'SQL::Translator::Parser::PostgreSQL': Parse failed. > > Line 33: COMMENT ON FUNCTION comma_cat(text, text) IS 'concatenation > of text inputs with comma separator'; > > > When I took all the offending lines out of the schema.sql file, > I got another error: > > Error: translate: Error with parser > 'SQL::Translator::Parser::PostgreSQL': Couldn't create table > 'my_table_name': Can't create table: "" exists at > /usr/lib/perl5/site_perl/5.8.8/SQL/Translator/Parser/PostgreSQL.pm > line 1035. > > I am running on CentOS 5.5, my PostgreSQL version is 8.4.4. What's my > outlook for getting an ER diagram done using sqlt-graph, please? > > Best, > -at ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev -- sqlfairy-developers mailing list sqlfairy-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers