Re: Problems on "copy" statement

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Problems on "copy" statement
Дата
Msg-id 20050413165411.GA91895@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Problems on "copy" statement  ("Keith Worthington" <keithw@narrowpathinc.com>)
Ответы Re: Problems on "copy" statement
Список 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/

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Keith Worthington"
Дата:
Сообщение: Re: Problems on "copy" statement
Следующее
От: "Anthony Mullen"
Дата:
Сообщение: Converting the sgml documentation...