From: Ken Youens-Clark Date: Wed, 17 Dec 2003 22:36:41 +0000 (+0000) Subject: Minor changes. X-Git-Tag: v0.06~249 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=211e2e90914b4ca1a31aefc8cafc50cd417dc49e;p=dbsrgits%2FSQL-Translator.git Minor changes. --- diff --git a/lib/SQL/Translator/Parser/PostgreSQL.pm b/lib/SQL/Translator/Parser/PostgreSQL.pm index e8492ad..042ac64 100644 --- a/lib/SQL/Translator/Parser/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/PostgreSQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::PostgreSQL; # ------------------------------------------------------------------- -# $Id: PostgreSQL.pm,v 1.34 2003-12-10 23:09:19 kycl4rk Exp $ +# $Id: PostgreSQL.pm,v 1.35 2003-12-17 22:36:41 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # Allen Day , @@ -111,7 +111,7 @@ View table: use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.34 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.35 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -230,7 +230,7 @@ create : create_table table_name '(' create_definition(s /,/) ')' table_option(s 1; } -create : /create/i unique(?) /(index|key)/i index_name /on/i table_name using_method(?) '(' field_name(s /,/) ')' where_predicate(?) ';' +create : CREATE unique(?) /(index|key)/i index_name /on/i table_name using_method(?) '(' field_name(s /,/) ')' where_predicate(?) ';' { push @{ $tables{ $item{'table_name'} }{'indices'} }, { @@ -245,9 +245,9 @@ create : /create/i unique(?) /(index|key)/i index_name /on/i table_name using_me } # -# Create anything else (e.g., domain, function, etc.) +# Create anything else (e.g., domain, etc.) # -create : /create/i WORD /[^;]+/ ';' +create : CREATE WORD /[^;]+/ ';' { @table_comments = (); } using_method : /using/i WORD { $item[2] } @@ -761,9 +761,9 @@ restrict_or_cascade : /restrict/i | # End basically useless stuff. - ky # -create_table : /create/i TABLE +create_table : CREATE TABLE -create_index : /create/i /index/i +create_index : CREATE /index/i default_val : DEFAULT /(\d+|'[^']*'|\w+\(.*?\))|\w+/ { @@ -805,6 +805,8 @@ ADD : /add/i ALTER : /alter/i +CREATE : /create/i + ONLY : /only/i DEFAULT : /default/i