Thread: Porting from MySQL.

Porting from MySQL.

From
Danny Appaiah
Date:
Hello Sir,

I have some issues with postgres.

We are planning to port a Billing Application from MySQL+PHP to
PostGres 7.1+PHP.

The issues are maily with capitalized column names.

My Table Name: NetworkName
Column Name1 : NetCode
Column Name2 : NetworkName

All over the application we have used statements like (After fetching *
from above table).

echo $Row["NetCode"]; and echo $Row["NetworkName"];

these statements return nothing where as statements like

echo $Row["netcode"]; and echo $Row["networkname"] display correct
values.

Why is this difference when my column names are capitalized. Even the "psql"
tool displays all column names in lower cases.

I need to port my application urgently ..

Thanks in Advance,
Danny Appaiah


Re: Porting from MySQL.

From
Marko Kreen
Date:
On Thu, Oct 04, 2001 at 04:10:26PM +0530, Danny Appaiah wrote:
> My Table Name: NetworkName
> Column Name1 : NetCode
> Column Name2 : NetworkName

By default PostgreSQL turns all table/column names to lowercase,
unless you tell it not to:

marko=# create table tEst (vAl text);
CREATE
marko=# create table "tEst2" ("vAl" text);
CREATE
marko=# \d test
        Table "test"
 Attribute | Type | Modifier
-----------+------+----------
 val       | text |

marko=# \d "tEst2"
        Table "tEst2"
 Attribute | Type | Modifier
-----------+------+----------
 vAl       | text |


--
marko