Skip site navigation (1) Skip section navigation (2)

Best practice to move from MySQL to PostgreSQL

From: Guenther Boelter <gboelter(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Best practice to move from MySQL to PostgreSQL
Date: 2010-12-02 04:04:36
Message-ID: 4CF71AD4.3030808@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
I've decided to change my application from MySQL to PostgreSQL and I'm 
already sure, it's a good decision.

 From what I know, using PostgreSQL, all fieldnames should be written in 
lowercase to avoid problems.

Unfortunately in MySQL my fields are named like this:

> BelegNummer, BelegDatum ....

so a query looks like this

> SELECT BelegNummer, BelegDatum FROM rechnungen ORDER BY BelegDatum ASC;

This will not work with PostgreSQL, because PostgreSQL will change all 
fieldnames to lowercase, right?

Means, I've to change all fieldnames to lowercase like belegnummer, 
belegdatum ....

Ok, that;s not a big problem. But is there something else I should do to 
avoid other problems?

Should I change my queries to something like this:

> SELECT belegnummer, belegdatum FROM rechnungen ORDER BY belegdatum ASC;

or will Postgre do this automatically while executing the query?

I only would like to make sure, that I'm right until here and/or is 
there is better way to convert an application from MyQSL to PostgreSQL 
before I'll start to change everything.

Thanks in advance for your help.

Responses

pgsql-novice by date

Next:From: Thomas KellererDate: 2010-12-02 07:49:15
Subject: Re: Best practice to move from MySQL to PostgreSQL
Previous:From: Frank BaxDate: 2010-12-02 03:29:47
Subject: Re: Get server's time in UTC time zone, in ISO 8601 format

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group