From: Justin Hunter Date: Thu, 24 Sep 2009 23:57:11 +0000 (-0700) Subject: some pg grammar fixes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a92e092fa6d9869f23bf47e9119cf158e32ba363;p=dbsrgits%2FSQL-Translator-2.0-ish.git some pg grammar fixes --- diff --git a/lib/SQL/Translator/Grammar/PostgreSQL.pm b/lib/SQL/Translator/Grammar/PostgreSQL.pm index a0be213..b7b8c0d 100644 --- a/lib/SQL/Translator/Grammar/PostgreSQL.pm +++ b/lib/SQL/Translator/Grammar/PostgreSQL.pm @@ -507,9 +507,9 @@ role SQL::Translator::Grammar::PostgreSQL { $return = { type => 'bytea' }; } | - /(timestamptz|timestamp)(?:\(\d\))?( with(out)? time zone)?/i + /(timestamptz|timestamp)(?:\(\d\))?( with(?:out)? time zone)?/i { - $return = { type => 'timestamp' }; + $return = { type => 'timestamp' . ($2||'') }; } | /text/i @@ -557,7 +557,7 @@ role SQL::Translator::Grammar::PostgreSQL { deferred => $item{'deferred'}, reference_table => $desc->{'reference_table'}, reference_fields => $desc->{'reference_fields'}, - match_type => $desc->{'match_type'}[0], + match_type => $desc->{'match_type'}, on_delete => $desc->{'on_delete'} || $desc->{'on_delete_do'}, on_update => $desc->{'on_update'} || $desc->{'on_update_do'}, comments => [ @comments ], @@ -615,10 +615,8 @@ role SQL::Translator::Grammar::PostgreSQL { deferred : /initially/i /(deferred|immediate)/i { $item[2] } - match_type : /match full/i { 'match_full' } - | - /match partial/i { 'match_partial' } - + match_type : /match/i /partial|full|simple/i { $item[2] } + key_action : key_delete | key_update