Re: PostgreSQL Gotchas

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Chris Travers <chris(at)travelamericas(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, "Aly S(dot)P Dharshi" <aly(dot)dharshi(at)telus(dot)net>, "Gavin M(dot) Roy" <gmr(at)ehpg(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Gotchas
Date: 2005-10-13 20:27:35
Message-ID: 20051013202725.GF6080@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 13, 2005 at 12:21:14PM -0700, Chris Travers wrote:
> >Since the end reward for all this work would be having to read CATALOGS
> >WRITTEN IN ALL UPPER CASE, none of the key developers seem very
> >interested ...
> >
> >
> Why would this be required? If an individual developer wants to have a
> db with folding to uppercase, that developer can easily quote any
> references to system tables himself. I don't see why this is a
> requirement. "Case sensitivity" is "Case sensitivity" is "Case
> sensitivity" ...

I think you're slightly missing the point. Most people won't need to
change any queries because unquoted identifiers are case-folded anyway.
Which way doesn't matter, as long as it's consistant. No the main
objection would be this (see below). Does anyone really want this? I'll
take lowercase anyday... (Note, it's not exact, some things aren't SQL
identifiers so would be left alone. But idea is the same.)

TEST=# \l
List of databases
Name | Owner | Encoding
-----------+----------+----------
TEMPLATE0 | POSTGRES | UNICODE
TEMPLATE1 | POSTGRES | UNICODE
<snip>
(6 rows)

TEST=# \df+ bit
List of functions
Result data type | Schema | Name | Argument data types | Owner | Language | Source code | Description
------------------+------------+------+-----------------------+----------+----------+-------------+------------------------------
BIT | PG_CATALOG | BIT | BIGINT | POSTGRES | INTERNAL | BITFROMINT8 | INT8 To BITSTRING
BIT | PG_CATALOG | BIT | BIT, INTEGER, BOOLEAN | POSTGRES | INTERNAL | BIT | Adjust BIT() to typomod length
BIT | PG_CATALOG | BIT | INTEGER | POSTGRES | INTERNAL | BITFROMINT4 | INT4 To BITSTRING
(3 rows)

TEST=# \d website
Table "PUBLIC.WEBSITE"
Column | Type | Modifiers
-----------+---------+-----------
FILENAME | TEXT |
TITLE | TEXT |
PARENT | TEXT |
HITS | INTEGER |
HIDDEN | BOOLEAN |
HITSMONTH | INTEGER |
Indexes:
"WEBSITE_FILENAME" UNIQUE, BTREE (FILENAME)

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2005-10-13 20:28:04 quoting was: Re: PostgreSQL 8.1 vs. MySQL 5.0?
Previous Message Rafael Montoya 2005-10-13 20:05:19 Windows Installation error