schema issues

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
robertoicardi
Posts: 27
Joined: Wed 28 Jan 2009 11:29

schema issues

Post by robertoicardi » Thu 29 Sep 2011 12:34

Hi, I'm in the process of (re)evaluating the driver...

First 10 minutes, first issue :D
My database is structured in public schema plus 2 more schemas... As I've put in postgresql.conf the search_path as schema1,schema2,public so far no one application has issues to trasparently invoke functions from any of the 3 schemas without qualification.

But with dbexpress driver I have no success: if I don't specify any schema name, seems that pgexpress driver send a set schema to public, so that the postgresql.conf settings are screwed and I am not able to call functions from the other 2 schemas anymore...
I've tried to set schema name with multiple schema, but so far no luck; I don't know if there's some syntax (doc says nothing about); I've tried with schema1,schema2,public and with schema1;schema2;public but no luck....

(by the way, I'm using BDS2006; I've tried syntax to set schema name as per documentation:

const
coSchemaName = TSQLConnectionOption(28 ) ; // string
. . .
SQLConnection1.SQLConnection.SetOption(coSchemaName, Integer(PChar('test')));

but what I obtain is a fantastic access violation ... so I've made my test with CRSqlConnection )

SO questions are:

1) is possible to avoid dbexpress to force schema name, so that it does use default system settings?
2) alternative, is there a way to set multiple schema?

thanks!!!!!!

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

Post by AlexP » Fri 30 Sep 2011 14:31

Hello,

Thank you for the information.
We've reproduced and fixed the problem.
This fix will be included in the next build.

Now you can use the following workaround:

Code: Select all

procedure TForm1.SQLConnection1AfterConnect(Sender: TObject);
begin
  SQLConnection1.Execute('SET search_path TO public,schema1,schema2',nil);
end;

robertoicardi
Posts: 27
Joined: Wed 28 Jan 2009 11:29

Post by robertoicardi » Fri 30 Sep 2011 22:24

AlexP wrote:Hello,

Thank you for the information.
We've reproduced and fixed the problem.
This fix will be included in the next build.

Now you can use the following workaround:

Code: Select all

procedure TForm1.SQLConnection1AfterConnect(Sender: TObject);
begin
  SQLConnection1.Execute('SET search_path TO public,schema1,schema2',nil);
end;
Thanks, that's exactly the workaround I've used ... now all works like charm... I've put online driver and if I'll not receive any complaint in a week or so I'll proceed with my order :)

Post Reply