Subject: | PostgreSQL Producer creates broken output when comments are included |
When the PostgreSQL producer creates output that includes comments, the
table definitions are not usable because the CREATE TABLE line gets
caught up in the previous comment line, like so...
--
-- Table: "users"
--CREATE TABLE "users" (
The attached patch corrects the problem, and a minor problem where the
output of header_comment is thrown away, as there is an '=' where there
should be a '.='.
Subject: | sql-translator-producer-postgresql.patch |
--- PostgreSQL.pm.orig 2006-12-05 14:33:31.000000000 -0500
+++ PostgreSQL.pm 2006-12-05 14:36:17.000000000 -0500
@@ -204,7 +204,7 @@
}
- $output = join("\n\n", @table_defs);
+ $output .= join("\n\n", @table_defs);
if ( @fks ) {
$output .= "--\n-- Foreign Key Definitions\n--\n\n" unless $no_comments
;
$output .= join( "\n\n", @fks ) . "\n";
@@ -324,7 +324,7 @@
# print STDERR "$table_name table_name\n";
my ( @comments, @field_defs, @sequence_defs, @constraint_defs, @fks );
- push @comments, "--\n-- Table: $table_name_ur\n--" unless $no_comments;
+ push @comments, "--\n-- Table: $table_name_ur\n--\n" unless $no_comments;
if ( $table->comments and !$no_comments ){
my $c = "-- Comments: \n-- ";