Page 1 of 1

Does TZConnection respect the schema settings of PostgreSQL?

Posted: 24.02.2016, 07:38
by vfclists
I am using the TZConnection from Zeoslib and although I set the schema in the connection, when I run a query it seems to revert to the PUBLIC schema. Unless I prefix tablenames with the schema name like

Code: Select all

select schemaname.tablename from schema
the queries don't work

Are schemas properly supported by Zeoslib?

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 24.02.2016, 08:40
by EgonHugeist
First of all switch to 7.2 to be on same band width.
And accordingly your question:

Yes of course we do and this is our default syntax. We also add the catalog like <catalog>.<schema>.<tablename>

Postgre uses case-sensitive identifiers. IS "PUBLIC" realy the name of the schema or is it "public"? Work case sensitive..

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 06.09.2020, 20:48
by wxin
I am having the same issue, and don't get the answer from this thread.

I am using PostgreSQL, how can I designate a specific schema using TZConnection, instead of connection to the default "public" schema?

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 07.09.2020, 09:54
by marsupilami
Hello,

usually it should be possible to change the default schema using the catalog property.

Best regards,

Jan

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 08.09.2020, 03:42
by wxin
Thank you for you kind reply. I am using 7.3.0-alpha, and Catalog doesn't seem to work?
marsupilami wrote: 07.09.2020, 09:54 Hello,

usually it should be possible to change the default schema using the catalog property.

Best regards,

Jan

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 10.09.2020, 10:20
by marsupilami
In that case I can only suggest to use something like MyZeosConnection.ExecuteDirect('SET search_path TO myschema,public;').
I created a feature request for tracking this: https://sourceforge.net/p/zeoslib/internaltickets/11/

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 10.09.2020, 14:00
by wxin
Thank you very much for the kind advice.

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 17.02.2024, 13:36
by vonhabsi
marsupilami wrote: 10.09.2020, 10:20 In that case I can only suggest to use something like MyZeosConnection.ExecuteDirect('SET search_path TO myschema,public;').
I created a feature request for tracking this: https://sourceforge.net/p/zeoslib/internaltickets/11/
It looks like the URL generated for libpq.dll does not include the search_path.

Where can the connection strings sent to libpq.dll be checked?

Re: Does TZConnection respect the schema settings of PostgreSQL?

Posted: 20.02.2024, 08:08
by marsupilami
Hello :)
vonhabsi wrote: 17.02.2024, 13:36 It looks like the URL generated for libpq.dll does not include the search_path.
No - it doesn't. This is what all this is about.
vonhabsi wrote: 17.02.2024, 13:36 Where can the connection strings sent to libpq.dll be checked?
Right now they can only be checked in the code when debugging. Have a look at ZDbcPostgreSql.pas.

Best regards,

Jan