Re: [INTERFACES] Case sensitive? - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: [INTERFACES] Case sensitive?
Date
Msg-id 19990413204412.B835@gmx.net
Whole thread Raw
List 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@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.Meskes@gmx.net          | Use PostgreSQL!

pgsql-interfaces by date:

Previous
From: Matthew Hagerty
Date:
Subject: Weighted Searchs
Next
From: Dave Page
Date:
Subject: RE: Bug Reports