From: Ross Smith II Date: Sat, 16 Aug 2003 20:12:09 +0000 (+0000) Subject: We need to quote the enum field values X-Git-Tag: v0.04~318 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d939726824f16ed2859754db3fd17dc6fe5f249a;p=dbsrgits%2FSQL-Translator.git We need to quote the enum field values --- diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index 70ba6b0..63e511a 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::PostgreSQL; # ------------------------------------------------------------------- -# $Id: PostgreSQL.pm,v 1.11 2003-06-23 21:47:30 kycl4rk Exp $ +# $Id: PostgreSQL.pm,v 1.12 2003-08-16 20:12:09 rossta Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -30,7 +30,7 @@ SQL::Translator::Producer::PostgreSQL - PostgreSQL producer for SQL::Translator use strict; use vars qw[ $DEBUG $WARN $VERSION ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.11 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; @@ -196,7 +196,8 @@ sub produce { my $data_type = lc $field->data_type; my %extra = $field->extra; my $list = $extra{'list'} || []; - my $commalist = join ",", @$list; + # \todo deal with embedded quotes + my $commalist = "'" . join("','", @$list) . "'"; my $seq_name; if ( $data_type eq 'enum' ) {