Hi Aleksey, When I want to use sqlfairy with my fairly complex database schema, I generally have two ddls: one for creating the database, that has functions and other items like that that are required for my database. The other schema (which I call "nofuncs") has just table, view and index declarations, along with COMMENT ON tables and columns. This is made easy for me as my schema is actually built from multiple components using a GUI that has a "SQL ONLY" button that creates the nofuncs schema easily. Since I've been doing this for years, it is not at all painful for me, but I can see how this might be unpleasant for you. You can of course offer a patch that fixes the postgres parser to handle these commands :-)
(Sorry, I'm not a sqlfairy developer, so I can't fix it either.) Scott 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 Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > -- > sqlfairy-developers mailing list > sqlfairy-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers > -- ------------------------------------------------------------------------ Scott Cain, Ph. D. scott at scottcain dot net GMOD Coordinator (http://gmod.org/) 216-392-3087 Ontario Institute for Cancer Research ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first -- sqlfairy-developers mailing list sqlfairy-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers