Re: [GENERAL] What is exactly a schema? - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] What is exactly a schema?
Date
Msg-id CAKFQuwa4EZAPCO08qJizNrGG6Z_CPK=3g+a8ivn+D9eM9hdyNQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] What is exactly a schema?  (marcelo <marcelo.nicolet@gmail.com>)
List pgsql-general
On Fri, Jul 14, 2017 at 9:13 AM, marcelo <marcelo.nicolet@gmail.com> wrote:
I'll be using Devart's dotConnect. I have two alternatives at this moment

a) To set the user name to the required schema. This has the (little) drawback that forces user configuration for every schema...

​With "ALTER ROLE SET" the user name and initial search_path are both explicitly specified and do not need to match...​

b) To manually do something like the JDBC driver you mention, but it triggers some questions
b.1) To execute the set search_path one must be connected, database name included. I think by that time, the default schema is determined. Or I am wrong, am I?

​You are mistaken.  When doing it at the connection-level an actual "SET search_path" SQL command is not generated - instead the server simply uses the data present in the connection string to change runtime variables before the connection is made ready for use.
 
b.2) The search_path is valid for the database or restricted to the connection?

​You need to rephrase this question.  From a client's perspective everything is restricted to the connection - and a given connection only exists to a single database at any given time.

And if you can avoid top-posting it would be much appreciated.

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] What is exactly a schema?
Next
From: John R Pierce
Date:
Subject: Re: [GENERAL] What is exactly a schema?