Feedback
Did this article resolve your question/issue?

   

Article

Case sensitivity issue with PostgreSQL ODBC Driver

Information

 
TitleCase sensitivity issue with PostgreSQL ODBC Driver
URL NameCase-sensitivity-issue-with-PostgreSQL-ODBC-Driver
Article Number000119006
EnvironmentProduct: Connect64 for ODBC PostgreSQL Wire Protocoldriver
Version: 07.16.0299
OS: Linux
Database: PostgreSQL
Application: All supported applications
Question/Problem Description
Case sensitivity issue with PostgreSQL ODBC Driver while doing SQLPrepare
Steps to ReproduceTable DLL used
create table postgres_test
(
"Column One" TEXT,
"column_two" TEXT,
"Column_Three" TEXT,
"COLUMN_FOUR" TEXT
);

1- Log on to ODBCTest application
2 - Use below query
INSERT INTO postgres_test("Column One",column_two,Column_Three,COLUMN_FOUR) VALUES ( ?, ?, ?, ?)
3 - Go to Stmt Menu -> SQLPrepare
4 - Getting reported error
Clarifying Information
Error Message[DataDirect][ODBC PostgreSQL Wire Protocol driver][PostgreSQL]ERROR: column "column_three" of relation "postgres_test" does not exist
Defect Number
Enhancement Number
Cause
This is expected behavior.
The case sensitivity issue is a PostgreSQL Database limitation.
Ref:-
https://stackoverflow.com/questions/43111996/why-postgresql-does-not-like-uppercase-table-names
https://stackoverflow.com/questions/21796446/postgres-case-sensitivity

Query Used:
INSERT INTO postgres_test("Column One",column_two,Column_Three,COLUMN_FOUR) VALUES ( ?, ?, ?, ?) 
 - Error NOT reported with first column ( Column One) because it is enclosed with the double quotes.
 - Error NOT reported with second column ( column_two ) because all are small characters.
 - Error reported with third column ( Column_Three ) because it is NOT enclosed with double quotes and having two capital letters ( C,T)

If column names contain capital letters, then need to use double quotes, otherwise, PostgreSQL database will refer every column name in small characters(in this case "Column_Three" is considering as "column_three".
Resolution
Use double quotes for column names, if column names contains capital letters.
Workaround
Notes
Last Modified Date12/12/2018 11:32 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.