Re: Problems on "copy" statement

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Keith Worthington <keithw(at)narrowpathinc(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problems on "copy" statement
Date: 2005-04-13 16:54:11
Message-ID: 20050413165411.GA91895@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Apr 13, 2005 at 12:36:09PM -0400, Keith Worthington wrote:
>
> I vaguely remember colliding with case sensitivity in 7.3.X when I first
> started using postgresql. I changed all my table and column names to
> lowercase to avoid the issue and I haven't thought about it since. That
> appears to be changed in 8.0.0 as SELECT * FROM myschema.tbl_name; and SELECT
> * FROM MySchema.Tbl_Name; work equally well. Is this a new supported now and
> forever behavior? IT would be nice for readability and compactness to be able
> to use SalesOrder.TblDetail.ItemID instead of sales_order.tbl_detail.item_id.

This isn't new behavior. If you don't quote identifiers then they're
folded to lowercase.

test=> SELECT version();
version
---------------------------------------------------------------------------
PostgreSQL 7.2.7 on sparc-sun-solaris2.9, compiled by GCC gcc (GCC) 3.4.2
(1 row)

test=> CREATE TABLE MyTable (myColumn text);
CREATE

test=> SELECT MYCOLUMN FROM MYTABLE;
mycolumn
----------
(0 rows)

test=> SELECT mycolumn FROM mytable;
mycolumn
----------
(0 rows)

test=> SELECT MyCoLuMn FROM mYtAbLe;
mycolumn
----------
(0 rows)

test=> \d
List of relations
Name | Type | Owner
---------+-------+-------
mytable | table | mfuhr
(1 row)

test=> \d mytable
Table "mytable"
Column | Type | Modifiers
----------+------+-----------
mycolumn | text |

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Anthony Mullen 2005-04-13 16:56:50 Converting the sgml documentation...
Previous Message Keith Worthington 2005-04-13 16:43:09 Re: Problems on "copy" statement