Subject: | MySQL -> PostgreSQL gets confused about unused names |
Here is sql from mysqldump that will break when translating to
PostgreSQL. Translating to Oracle or DB2 works OK.
CREATE TABLE `neighborhood` (
`neighborhood_id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
PRIMARY KEY (`neighborhood_id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `event` (
`event_id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` text,
`location` int(11) NOT NULL default '0',
`start_date` date NOT NULL default '0000-00-00',
`end_date` date NOT NULL default '0000-00-00',
PRIMARY KEY (`event_id`),
KEY `start_date` (`start_date`,`end_date`),
KEY `location` (`location`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `location` (
`location_id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` text,
`neighborhood` int(11) NOT NULL default '0',
PRIMARY KEY (`location_id`),
KEY `name` (`name`),
KEY `neighborhood` (`neighborhood`),
KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
$ sqlt -f MySQL -t PostgreSQL artcal3.sql
Error: translate: Error with producer
'SQL::Translator::Producer::PostgreSQL': Can't use string ("location")
as a HASH ref while "strict refs" in use at
/opt/perl-5.8.8/lib/site_perl/5.8.8/SQL/Translator/Producer/PostgreSQL.pm
line 294.
$ perl -v
This is perl, v5.8.8 built for i686-linux
SQL-Translator-0.0899_01
Linux artcat.net 2.6.9-023stab044.16-smp #1 SMP Fri Nov 23 20:37:16 MSK
2007 i686 i686 i386 GNU/Linux