By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,777 Members | 1,755 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,777 IT Pros & Developers. It's quick & easy.

Casing: bug?

P: n/a
Hello there,

I have quite problem with PG 7.3 & 7.4b5
I create tables using pgAdmin3 v-1.0.1
I created a table "xType". Pay attention to capital "T" letter.
Than I tryed to insert data to it using psql tool.
But I have error: 'ERROR: relation "xtype" does not exist'
In error all chars are small!
If I create table in pgAdmin using all small chars, everithing works fine.

Note: when I create table with a capital chars from psql, it is created with
small chars.

Ok, as I write this mail I found ansver to my question: I have to wrap table
names in quote chars to avoid downcasing. I have to write:
select * from "xType";
than it works.

So now question is: why "select * from xTypes" is a wrong query, why table
name is downcasing if it is not wrapped in quote? Is it a bug, or it's
according to some standard?

Doesn't it violate documentation:
==========================
Identifier and key word names are case insensitive. Therefore
UPDATE MY_TABLE SET A = 5;
can equivalently be written as
uPDaTE my_TabLE SeT a = 5;
==========================

Thanks,

Vadim Chekan.
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you put quotes arounds the table name when you create it, then you will
need then whenever you refer to it also. If when you create the table you
don't use quotes, then you won't need then during the query either, as the
documentation says.

Without quotes, Postgresql is neither case-sensetive nor case-preserving.
With quotes it's both.

Hoe this helps,

On Sun, Oct 26, 2003 at 10:43:58AM +0000, Vadim Chekan wrote:
Hello there,

I have quite problem with PG 7.3 & 7.4b5
I create tables using pgAdmin3 v-1.0.1
I created a table "xType". Pay attention to capital "T" letter.
Than I tryed to insert data to it using psql tool.
But I have error: 'ERROR: relation "xtype" does not exist'
In error all chars are small!
If I create table in pgAdmin using all small chars, everithing works fine.

Note: when I create table with a capital chars from psql, it is created with
small chars.

Ok, as I write this mail I found ansver to my question: I have to wrap table
names in quote chars to avoid downcasing. I have to write:
select * from "xType";
than it works.

So now question is: why "select * from xTypes" is a wrong query, why table
name is downcasing if it is not wrapped in quote? Is it a bug, or it's
according to some standard?

Doesn't it violate documentation:
==========================
Identifier and key word names are case insensitive. Therefore
UPDATE MY_TABLE SET A = 5;
can equivalently be written as
uPDaTE my_TabLE SeT a = 5;
==========================

Thanks,

Vadim Chekan.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
--
Martijn van Oosterhout <kl*****@svana.org> http://svana.org/kleptog/ "All that is needed for the forces of evil to triumph is for enough good
men to do nothing." - Edmond Burke
"The penalty good people pay for not being interested in politics is to be
governed by people worse than themselves." - Plato


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/nEogY5Twig3Ge+YRAgMGAJ425f52xuTfCVZGo2MNLaGu3xq7kg CfchYg
DX66RxWJZda+ahL40AVTWJ4=
=QS9p
-----END PGP SIGNATURE-----

Nov 12 '05 #2

P: n/a
On Sun, Oct 26, 2003 at 10:43:58AM +0000, Vadim Chekan wrote:
Hello there,

I have quite problem with PG 7.3 & 7.4b5
I create tables using pgAdmin3 v-1.0.1
I created a table "xType". Pay attention to capital "T" letter.
And when you created it, dod you write it "xType" or xType? With the
quotes, you enforce cases-sensitivity.
Doesn't it violate documentation:


No. The same page says that "" will enforce the case you wrote.

A

--
----
Andrew Sullivan 204-4141 Yonge Street
Afilias Canada Toronto, Ontario Canada
<an****@libertyrms.info> M2P 2A8
+1 416 646 3304 x110
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.