Subject: | problem parsing postgres schema |
While trying to convert the attached file to GraphViz, I encountered a
couple of problems:
1. Functions whose bodies are inside dollar quotes: $$ ... $$ did not
parse correctly. I don't know whether this problem is more general.
2. I got lots of errors like these:
"translate: Error with parser 'SQL::Translator::Parser::PostgreSQL':
Couldn't create table 'net_addresses': Can't create table: "" exists at
/usr/share/perl5/SQL/Translator/Parser/PostgreSQL.pm line 998."
I was able to get around them only by renaming every table so that no
table's name was a prefix of another's, and deleting a large number of
indexes.
The program I ran is below; it's taken straight out of the documentation.
I'm running Debian-maintained Perl 5.10 on lenny.
Thanks!
~ Aleks
#!/usr/bin/perl
use strict;
use warnings;
use SQL::Translator;
my $trans = new SQL::Translator(
from => 'PostgreSQL',
to => 'GraphViz',
filename => '/home/aleks/pro/udb/schema/schema.sql2',
producer_args => {
out_file => '/home/aleks/pro/udb/schema/schema.png',
add_color => 1,
show_constraints => 1,
show_datatypes => 1,
show_sizes => 1
}
) or die SQL::Translator->error;
$trans->translate or die $trans->error;
Subject: | schema.sql |
Message body is not shown because it is too large.