473,800 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PG case sensitivity

Hello,

I am running into a problem with PGs case sensitivity with regard to column and
table names. I am using program components that require the object names
returned from database metadata queries to be in uppercase. Therefore, I am
forced to use double quotes in the table creation scripts, like

create table "BLA" ();

However, after doing that, all scripts that reference objects without quotes
fail, as PG seems to internally translate to lowercase in the absence of
quotes. I am forced to touch each and every column and table name in every
script. Questions:

1) can PG be configured to operate case insensitive?
2) why in the world was case sensitivity introduced at all? AFAIK, the SQL
standard explicitly states that names are case insensitive, and it seems to me
that PG goes against that standard. In fact, if there is no solution to this
problem, my conclusion will probably be to drop PG altogether, as we need DB
interoperabilit y on the program and script level, and this is becoming
unmaintainable. .

thanks,
christian

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
14 2366

Hi,

On Tue, 14 Sep 2004, Christian Sell wrote:
I am running into a problem with PGs case sensitivity with regard to column and
table names. I am using program components that require the object names
returned from database metadata queries to be in uppercase. Therefore, I am
forced to use double quotes in the table creation scripts, like

create table "BLA" ();

<snip>

I'll not answer your question but... I wonder why people want to use
capital letters in table names... I've been developing apps for years and
I never ever needed to capitalize my table names...

Regards,
--
Devrim GUNDUZ
devrim~gunduz.o rg devrim.gunduz~l inux.org.tr
http://www.tdmsoft.com
http://www.gunduz.org

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
On Tue, 2004-09-14 at 12:37, Christian Sell wrote:
Hello,

I am running into a problem with PGs case sensitivity with regard to column and
table names. I am using program components that require the object names
returned from database metadata queries to be in uppercase. Therefore, I am
forced to use double quotes in the table creation scripts, like
Why do programs that interface with case-insensitive SQL require a
particular case?
create table "BLA" ();

However, after doing that, all scripts that reference objects without quotes
fail, as PG seems to internally translate to lowercase in the absence of
quotes. I am forced to touch each and every column and table name in every
script. Questions:

1) can PG be configured to operate case insensitive?
It does, but in lower case (which is a good deal more readable). Using
lower rather than upper case is a decision made many years ago.
2) why in the world was case sensitivity introduced at all? AFAIK, the SQL
standard explicitly states that names are case insensitive, and it seems to me
that PG goes against that standard.


It doesn't. It simply folds to lower case rather than upper case. If
things are truly case-insensitive, this should be of no consequence.

The fault is with your program components that are insisting on upper
case rather than accepting either case. Perhaps you need some
intermediate component to swap case on identifiers for their benefit.

--
Oliver Elphick ol**@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
=============== =============== ==========
"But without faith it is impossible to please him; for
he that cometh to God must believe that he is, and
that he is a rewarder of them that diligently seek
him." Hebrews 11:6
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #3
Christian Sell wrote:
1) can PG be configured to operate case insensitive?
No.
2) why in the world was case sensitivity introduced at all?


Because the SQL standard specifies it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #4

I have a table containing coordinates and I want to insert these into
another table, converting them to boxes.

I would like to use the same syntax as arrays :

INSERT INTO ... (coords) SELECT ARRAY[a,b,c] FROM ...

But I want boxes. Is there a way to do this ?

SELECT BOX[[a,b],[c,d]] FROM ...
raises a Syntax Error.
And I'd like to avoid to concatenate strings to build a box
representation like
'((1,2),(3,4))' ::box;

Is there a way ?

Thanks !

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #5
> I'll not answer your question but... I wonder why people want to use
capital letters in table names... I've been developing apps for years and
I never ever needed to capitalize my table names...


as I wrote in my mail, its a matter of interoperabilit y in a multi-DBMS
environment with existing scripts. If it was all PG, no problem.

Anyhow, I still dont see why

select * from A
-- and
select * from "A"

are different things, if the standard requires case insensitivity.
christian

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #6
Christian Sell wrote:
Anyhow, I still dont see why

select * from A
-- and
select * from "A"

are different things, if the standard requires case insensitivity.


You're operating under flawed assumptions. Please read the
documentation for the full details:
http://www.postgresql.org/docs/7.4/s...AX-IDENTIFIERS

--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #7
In article <20************ ************@gm x.net>,
Peter Eisentraut <pe*****@gmx.ne t> writes:
Christian Sell wrote:
1) can PG be configured to operate case insensitive?
No. 2) why in the world was case sensitivity introduced at all?

Because the SQL standard specifies it.


I think it's the other way round. "CREATE TABLE SHIT" and "create
table shit" are the same according to the SQL standard, and they are
the same for PostgreSQL. The 'gotcha' is that when you ask PostgreSQL
for the table name you get "shit" and not "SHIT", as opposed to many
other DBMSs.
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #8

On Tue, 14 Sep 2004, Christian Sell wrote:
Hello,

I am running into a problem with PGs case sensitivity with regard to column and
table names. I am using program components that require the object names
returned from database metadata queries to be in uppercase. Therefore, I am
forced to use double quotes in the table creation scripts, like

create table "BLA" ();

However, after doing that, all scripts that reference objects without quotes
fail, as PG seems to internally translate to lowercase in the absence of
quotes. I am forced to touch each and every column and table name in every
script. Questions:

1) can PG be configured to operate case insensitive?
2) why in the world was case sensitivity introduced at all? AFAIK, the SQL
standard explicitly states that names are case insensitive, and it seems to me
that PG goes against that standard. In fact, if there is no solution to this


No, the SQL spec says that names are case folded to uppercase, although we
currently case-fold to lowercase (and can't really wholesale change that
for backwards compatibility reasons). There's been talk about supporting a
mode which case folds the other direction. In general, however, mixing
quoted and unquoted names is dangerous in all complient databases, because
in none would "Bla" and bla or BLA be the same name.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #9
On Tue, 14 Sep 2004, Oliver Elphick wrote:
The fault is with your program components that are insisting on upper
case rather than accepting either case.


In defence of this unknown component, the sql specifications says that
identifiers should be upper cased where pg do lower case.

I would welcome a initdb setting that defines what to use.

--
/Dennis Björklund
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
3168
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some sort? Thanks, Elliot
761
28979
by: Neo-LISPer | last post by:
Hey Recently, I researched using C++ for game programming and here is what I found: C++ game developers spend a lot of their time debugging corrupted memory. Few, if any, compilers offer completely safe modes. Unsurprisingly, there is a very high failure rate among projects using C++ for modern game development.
16
2943
by: Starwiz | last post by:
I'm a VB.net programmer, and I'm about to start working with two C++ programmers and teach them .net. I've decided to use C# in teaching them, since it's similar enough to VB.net that I can read and write it, and it's what's most familiar to them. My major problem with C#, however, is its case- sensitivity. I've heard people talk about how wonderful it is until they're blue in the face, but the fact stands
3
1147
by: Jason Tesser | last post by:
I am converting data from Access into Postgres and ran into an issue with case sensitivity. Can I write queries in Access that will be case insensitive without rewriting the queries. So I would like to know if this be handled in Postgres or even if someone knows in Access. Thank you.
15
1567
by: gregory_may | last post by:
Is there any options in VS 2005 to better handle case issues in C# (Similar to VB.Net)?
1
1868
by: othellomy | last post by:
Is SQL server defaults to case insensitive? I am sure there are ways to install case sensitive SQL server instance but coming from Sybase (which is always case sensitive) case insensitivity is something new to me (it requires coding change etc). Besides, is there any option I can set to turn on case sensitivity or I am stuck with it? (I can not reinstall SQL server). Thanks.
3
4264
by: Anita Potekkat | last post by:
Hello, I had a question regarding Case Sensitivity in 10g & 9i. (1) Does Case Sensitivity in Oracle have to do with data only? Or does it also effect table & column names? For e.g. in a table NAMES with column NAME are the following queries equivalent regardless of whether case sensitivity is turned on or off. select name from names; select NAME from names; select name from NAMES; select NAME from NAMES;
2
8460
by: sweetpotatop | last post by:
Hi, I believe my SQL server was configured as Case sensitivity. I have a number of stored procedures which were moved from a non-Case sensitivity SQL server. Because of the Case sensitivity, I have to do a lot of editing in those stored procedures. Is there a quick way to avoid the editing? Something like ignoring the case in one statement?
2
7285
by: Lucky | last post by:
Hi guys, I'm having problem with case sensitive collation of SQL Database. one my client is having case sensitive database. While developing the Data Layer i didn't consider this scenario. the problem is I've all Store Procedures in the Database and I'm using sqlcommand to execute those SPs with Parameters. for e.g. Data Layer: ...... SqlCommand cmd = new SqlCommand();
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.