3

Every time I open pgAdmin I have to do this:

set search_path="schema";

Is there a way to set a default search path value?

1
5

yes, you can modify the user:

alter role «user_name» set search_path = '«schema_name»';
1
  • 2
    Note that the single quotes around the schema_name are optional, unless maybe you have some non alphanumeric characters in it. And of course you can set search_path to a comma separated list of schema names.
    – laurent
    Aug 4 '17 at 12:32
1

You can also use macro feature of pgAdmin III to simplify task.

Although first answer is correct you can accidentally overwrite user related configuration the app can rely on. If application is not well written or is very complex and you have to use the same user, it is better to use feature of pgAdmin.

I haven't found better working solution in pgAdmin III 1.20 than assigning a macro to keyboard shortcut with instruction to alter search path - it's a regular SET search_path=first_schema, second_schema I assume the best solution will be to set search_path property of DB instance for pgAdmin connection, but despite presence of Properties.../Variables tab in instance context menu it looks disabled.

0

To set the value DB-wide you can also set a parameter for search_path in the database properties pane (confirmed in pgAdmin 5.7).

DB properties pane image

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.