Re: [INTERFACES] Case sensitive?

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Pavel PaJaSoft Janousek <janousek(at)fonet(dot)cz>
Cc: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: [INTERFACES] Case sensitive?
Date: 1999-04-13 18:44:12
Message-ID: 19990413204412.B835@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Mon, Apr 12, 1999 at 12:55:56PM +0200, Pavel PaJaSoft Janousek wrote:
> Fine, SQL and ECPG is case insensitive, but why I couldn't access any
> column which has name with upper character(s)? Problem isn't in C program,
> which is produced by ECPG, but somebody between comunication, isn't it?

Can you access that column from psql with the very same statement?

> I never may use this:
>
> exec sql select sum (Col1) from tmp; - this is internaly (by ECPG) converted
> to: exec sql select sum (col1) from tmp;
>
> because when table contains columnt 'Col1', I've got message that 'col1'
> doesn't exist (by sqlca).

This is the expected behaviour yes, but you should get the same when using
psql.

Try this:

postgres(at)tanja:~$ psql mm
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL

type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: mm

mm=> create table test (Col1 int);
CREATE
mm=> select * from test;
col1
----
(0 rows)

mm=> select Col1 from test;
col1
----
(0 rows)

As you see the create statement is tranformed to lowercase so there is no
column Col1. And you can access col1 (even as Col1) from ecpg.

Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael(dot)Meskes(at)gmx(dot)net | Use PostgreSQL!

Browse pgsql-interfaces by date

  From Date Subject
Next Message Rolf Brunsendorf 1999-04-13 18:56:25 Question about psql client
Previous Message Rolf Brunsendorf 1999-04-13 16:26:51 Question about psql for win32