Re: newbie - postgresql or mysql

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Frank <farocco(at)verizon(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: newbie - postgresql or mysql
Date: 2005-08-31 19:20:08
Message-ID: 20050831192008.GD98175@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

MySQL has a nasty habit of ignoring standards; in every other database
I've used, if you want to quote an identifier (such as a field name),
you use ", not `.

The fields are also incompatable. int() is non-standard, for starters.

There are MySQL to PostgreSQL conversion tools out there that should
help.

On Wed, Aug 31, 2005 at 02:50:16PM -0400, Frank wrote:
> Thanks for the feedback, sorry I was not more specific.
> We are a non-profit hospital and have been using MySQL for about 4 years.
>
> I wanted to convert some apps over to use postgresql and cannot find
> a good tool to import and auto create the tables.
> MySQL syntax is not compatible with postgresql.
> I get:
> ERROR: syntax error at or near "`" at character 14
> from the MySQL output below.
>
> CREATE TABLE `category` (
> `category_id` int(11) NOT NULL auto_increment,
> `category` char(50) default NULL,
> `LastUser` int(11) NOT NULL default '0',
> `LastUpdated` timestamp NOT NULL default CURRENT_TIMESTAMP on
> update CURRENT_TIMESTAMP,
> PRIMARY KEY (`category_id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
>
>
> insert into category values
> (4, 'Hardware - Monitor', 2, '2004-10-12 10:50:01'),
> (5, 'Hardware - Printer', 2, '2004-10-12 10:50:02'),
> (6, 'Hardware - Terminal', 2, '2004-10-12 10:50:02'),
> (7, 'Hardware - PC Laptop', 2, '2004-10-12 10:50:02'),
> (9, 'Hardware - Misc.', 1, '2004-10-12 10:51:00'),
> (10, 'Hardware - PC Desktop', 2, '2004-10-12 10:50:03'),
> (11, 'Software - PC', 2, '2004-10-12 10:50:03'),
> (13, 'Software - Network', 2, '2004-10-12 10:50:04'),
> (14, 'Software - Midrange, AS/400', 2, '2004-10-12 10:50:04'),
> (15, 'Software - Server', 2, '2004-10-12 10:50:04'),
> (16, 'Hardware - Wyse Terminal', 2, '2004-10-12 10:50:05');
>
> Regards,
>
> Frank
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-08-31 19:22:43 Re: temp tables remain after server restart
Previous Message Frank 2005-08-31 19:17:29 Re: newbie - postgresql or mysql