Issue when using schema with camel case (v3.1.4-v3.1.5)

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
syagrius
Posts: 10
Joined: Sat 28 Feb 2009 13:45

Issue when using schema with camel case (v3.1.4-v3.1.5)

Post by syagrius » Wed 21 Mar 2012 14:57

Hello,

I have an issue since PgDac v3.1.5 (V2 was ok).
Bug tested under D7/D2010/Posgresql9.x

How to reproduce:
Rename public schema to Public for instance.

Code: Select all

ALTER SCHEMA public RENAME TO "Public";
(1)
Try to connect with a TPgconnection.
You got: invalid parameter for "search path" : "public"

(2)
Try to call PgConnection1.GetTableNames(MyListbox, false).
(You must have AllTable parameter to False)
GetTableNames() returns nothing because the generated query is malformed (escaping issue).

Code: Select all

SELECT current_database() AS TABLE_CATALOG, n.nspname AS TABLE_SCHEMA, c.relname AS TABLE_NAME, c.oid AS TABLE_OID, CASE   WHEN c.relkind = 'r' THEN 'TABLE'   WHEN c.relkind = 'v' THEN 'VIEW' END::varchar(5) AS TABLE_TYPE FROM pg_class c INNER JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE n.nspname = '\"Public\"' AND  c.relkind IN ('r', 'v') ORDER BY n.nspname, c.relname
The where clause is
WHERE n.nspname = '\"Public\"'
but should be
WHERE n.nspname = 'Public'


(3)
Now with release 3.1.5 we can have a dot in schema.
But GetTableName() still failing.
Due to same escaping issue I think.

Many Thanks,
Syagrius

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 22 Mar 2012 09:58

Hello,

1) When connecting to a PostgreSQL server, if the PgConnection1.Schema property is not assigned, we don't set search_path, and the PostgreSQL default schema is used. Therefore, even when renaming the default schema, no error occurs.
2) 3) We have fixed this problem, the fix will be included in the next build

Post Reply