Page 1 of 1

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

Posted: Wed 21 Mar 2012 14:57
by syagrius
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

Posted: Thu 22 Mar 2012 09:58
by AlexP
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