Multiple schema

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
arkangles
Posts: 3
Joined: Sun 26 Apr 2009 12:02

Multiple schema

Post by arkangles » Sun 26 Apr 2009 13:29

The default schema is "public", and the setoption command apparently can only set this to one specific schema. Is there any way to be able to access all schema, or a specific list of schema at the same time?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 05 May 2009 07:57

You can execute SET SEARCH_PATH command to use several schemas. For example:

Code: Select all

SQLConnection.ExecDirect('SET SEARCH_PATH TO public, schema2');

arkangles
Posts: 3
Joined: Sun 26 Apr 2009 12:02

Post by arkangles » Sun 24 May 2009 04:16

Doesn't seem to make any difference. I run

Code: Select all

SQLConnection.ExecuteDirect('SET SEARCH_PATH TO public, myschema');
SQLConnection.GetTableNames(MyList);
and MyList still only contains the tables and views that are in the PUBLIC schema. Is there some other setting I need to use as well?

--Rob.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 12 Jun 2009 09:01

The GetTableNames method will always return the list of tables from one schema. This method uses the schema from the SchemaName extended driver option. You can see how to set the extended driver options in the ReadMe.html file.

Post Reply