google-code-export / gambas

Automatically exported from code.google.com/p/gambas
1 stars 0 forks source link

DataSource.Table does not read tables with non-lowercase names (PostgreSQL) #339

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If a table has a non-lowercase name it is impossible to use it with 
DataSource.Table since it seems to be "converted" to lowercase and the system 
returns an error about a non-existent table (SQL is case insensitive which is 
why this happens). Haven't tested with other DBMS, but with PostgreSQL 9.1.5:

db=# CREATE TABLE "Uppercase" ( id SERIAL );
NOTICE:  CREATE TABLE will create implicit sequence "Uppercase_id_seq" for 
serial column "Uppercase.id"
CREATE TABLE

Then in Gambas3

DS.Table = "Uppercase"

where DS is a DataSource connected to the db above, raises the error:

Query failed: ERROR: Relation "uppercase" does not exist LINE 1: SELECT 
COUNT(*) AS nRecord FROM Uppercase

The query above would be correct if there were double quotes around the table 
name, e.g.

SELECT COUNT(*) AS nRecord FROM "Uppercase"

System info
-----------
Version: 3.3.0
Operating system: Linux
Distribution: Ubuntu
Architecture: x86
GUI component: QT4

Original issue reported on code.google.com by schatten.markus on 23 Oct 2012 at 2:12

GoogleCodeExporter commented 9 years ago
It should have been fixed in revision #5250.

Original comment by benoit.m...@gmail.com on 25 Oct 2012 at 7:23