Fix PostgreSQL grammar parsing of UUID, time, timetz column types
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / PostgreSQL.pm
index ce3cfbb..dc05928 100644 (file)
@@ -613,11 +613,16 @@ pg_data_type :
             $return = { type => 'bytea' };
         }
     |
-    /(timestamptz|timestamp)(?:\(\d\))?( with(?:out)? time zone)?/i
+    / ( timestamp (?:tz)? ) (?: \( \d \) )? ( \s with (?:out)? \s time \s zone )? /ix
         {
             $return = { type => 'timestamp' . ($2||'') };
         }
     |
+    / ( time (?:tz)? ) (?: \( \d \) )? ( \s with (?:out)? \s time \s zone )? /ix
+        {
+            $return = { type => 'time' . ($2||'') };
+        }
+    |
     /text/i
         {
             $return = {
@@ -626,7 +631,7 @@ pg_data_type :
             };
         }
     |
-    /(bit|box|cidr|circle|date|inet|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|timetz|time|varchar|json|hstore)/i
+    /(bit|box|cidr|circle|date|inet|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|varchar|json|hstore|uuid)/i
         {
             $return = { type => $item[1] };
         }