Skip Menu |

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

Report information
The Basics
Id: 2934
Status: resolved
Worked: 3 min
Priority: 0/
Queue: SQL-Translator

People
Owner: kclark [...] cpan.org
Requestors: richardc [...] unixbeard.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.02
Fixed in: (no value)



Subject: SQL::Translator::Parser::PostgreSQL case sensitivity
Hi, in running SQL::Translator against a postegresql schema I discovered that it was case sensitive when it came to variable types, which is an issue for us. The attached patch makes it case insensitive. I hope you find it useful. -- Richard Clamp <richardc@unixbeard.net>
Only in SQL-Translator-0.02_hacked: Makefile Only in SQL-Translator-0.02_hacked: blib diff -ur SQL-Translator-0.02/lib/SQL/Translator/Parser/PostgreSQL.pm SQL-Translator-0.02_hacked/lib/SQL/Translator/Parser/PostgreSQL.pm --- SQL-Translator-0.02/lib/SQL/Translator/Parser/PostgreSQL.pm 2003-06-17 03:12:23.000000000 +0100 +++ SQL-Translator-0.02_hacked/lib/SQL/Translator/Parser/PostgreSQL.pm 2003-07-11 12:56:15.000000000 +0100 @@ -385,7 +385,7 @@ } pg_data_type : - /(bigint|int8|bigserial|serial8)/ + /(bigint|int8|bigserial|serial8)/i { $return = { type => 'integer', @@ -394,7 +394,7 @@ }; } | - /(smallint|int2)/ + /(smallint|int2)/i { $return = { type => 'integer', @@ -402,7 +402,7 @@ }; } | - /int(eger)?|int4/ + /int(eger)?|int4/i { $return = { type => 'integer', @@ -410,7 +410,7 @@ }; } | - /(double precision|float8?)/ + /(double precision|float8?)/i { $return = { type => 'float', @@ -418,7 +418,7 @@ }; } | - /(real|float4)/ + /(real|float4)/i { $return = { type => 'real', @@ -426,7 +426,7 @@ }; } | - /serial4?/ + /serial4?/i { $return = { type => 'integer', @@ -435,7 +435,7 @@ }; } | - /bigserial/ + /bigserial/i { $return = { type => 'integer', @@ -444,37 +444,37 @@ }; } | - /(bit varying|varbit)/ + /(bit varying|varbit)/i { $return = { type => 'varbit' }; } | - /character varying/ + /character varying/i { $return = { type => 'varchar' }; } | - /char(acter)?/ + /char(acter)?/i { $return = { type => 'char' }; } | - /bool(ean)?/ + /bool(ean)?/i { $return = { type => 'boolean' }; } | - /bytea/ + /bytea/i { $return = { type => 'bytea' }; } | - /timestampz?/ + /timestampz?/i { $return = { type => 'timestamp' }; } | - /(bit|box|cidr|circle|date|inet|interval|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|text|time|varchar)/ + /(bit|box|cidr|circle|date|inet|interval|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|text|time|varchar)/i { $return = { type => $item[1] }; } @@ -533,7 +533,7 @@ } } | - /check/ '(' /(.+)/ ')' + /check/i '(' /(.+)/ ')' { $return = { type => 'check', Only in SQL-Translator-0.02_hacked: pm_to_blib
Made appropriate changes to remove case-sensitivity. Thanks, Richard! ky