Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 18096
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: nigel.metheringham [...] Dev.intechnology.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07
Fixed in: (no value)



Subject: Bug in PostgreSQL parser
The PostgreSQL parser fails on column specifications such as ts timestamp without time zone although the parser grammer should handle this. Looks like a bug in Parse::RecDescent. However it can be worked around by merging the grammar lines for timestamp with time zone and timestamp without time zone The attached patch fixes this for me...
Subject: patch.diff
Index: lib/SQL/Translator/Parser/PostgreSQL.pm --- /tmp/old/PostgreSQL.pm 2006-03-10 12:17:34.000000000 +0000 +++ /tmp/new/PostgreSQL.pm 2006-03-10 12:12:22.000000000 +0000 @@ -546,12 +546,7 @@ $return = { type => 'bytea' }; } | - /(timestamptz|timestamp)( with time zone)?/i - { - $return = { type => 'timestamp' }; - } - | - /(timestamptz|timestamp)( without time zone)?/i + /(timestamptz|timestamp)( with(out)? time zone)?/i { $return = { type => 'timestamp' }; }
Subject: Re: [rt.cpan.org #18096] test case
Date: Fri, 10 Mar 2006 12:25:58 +0000
To: bug-SQL-Translator [...] rt.cpan.org
From: Nigel Metheringham <nigel.metheringham [...] dev.intechnology.co.uk>
The following table definition is ignored by the PostgreSQL parser in vanilla 0.07 CREATE TABLE "sessions" ( "se_id" serial PRIMARY KEY, "us_id" integer NOT NULL, "se_cookie" varchar(64) UNIQUE NOT NULL, "se_ip" inet NOT NULL, "se_start" timestamp without time zone NOT NULL, "se_expiry" timestamp without time zone NOT NULL ); -- [ Nigel Metheringham Nigel.Metheringham@InTechnology.co.uk ] [ - Comments in this message are my own and not ITO opinion/policy - ]
On Fri Mar 10 07:27:03 2006, nigel.metheringham@Dev.intechnology.co.uk wrote: Show quoted text
> The following table definition is ignored by the PostgreSQL parser in > vanilla 0.07 > > CREATE TABLE "sessions" ( > "se_id" serial PRIMARY KEY, > "us_id" integer NOT NULL, > "se_cookie" varchar(64) UNIQUE NOT NULL, > "se_ip" inet NOT NULL, > "se_start" timestamp without time zone NOT NULL, > "se_expiry" timestamp without time zone NOT NULL > );
Applied and in 0.08_01, thanks. Jess