Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8722841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:29:54+00:00 2026-06-13T07:29:54+00:00

The scenario CREATE SCHEMA testschema; CREATE ROLE testrole LOGIN; GRANT ALL ON SCHEMA testschema

  • 0

The scenario

CREATE SCHEMA testschema;
CREATE ROLE testrole LOGIN;
GRANT ALL ON SCHEMA testschema TO testrole;
ALTER ROLE testrole SET search_path = testschema;

Now if I initiate the connection (log in) as testrole then:

SHOW search_path; 

Gives the desired result:

search_path 
-------------
testschema
(1 row)

However, if I initiate connection (log in) as a superuser and do:

SET SESSION AUTHORIZATION testrole;
SHOW search_path;

Results in:

search_path   
----------------
"$user",public
(1 row)

(or whatever the search path of the superuser is)


My question is, why does SET SESSION AUTHORIZATION not affect the current search_path?
Is it a bug, by design or am I simply doinitwrong?

From the little I’ve found, the workaround of SET SEARCH path = schemaname after SET SESSION... seems to be the only solution, but that kind of defeats the purpose of having persistent search paths assigned to roles.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:29:55+00:00Added an answer on June 13, 2026 at 7:29 am

    This is by design. I quote the manual on ALTER ROLE

    This only happens at login time; executing SET ROLE or SET SESSION
    AUTHORIZATION does not cause new configuration values to be set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenarios: Scenario: Create a game with valid information Given I
I used to create scenarios where in scenario name I explain what is scenario.
How would I create the following scenario that rails can provide for carrierwave, using
Here's the scenario: I have 2 tables: CREATE TABLE dbo.API_User ( id int NOT
How do i create aliases in c# Take this scenario class CommandMessages { string
I have the following scenario, I want to create a DataGrid and then populate
I need to create relationships for my entities, whereby I have the following scenario:
I am trying to create a generic formatter/parser combination. Example scenario: I have a
I am trying to create a little helper application, one scenario is file duplication
We are thinking about to create new schema with its own 3 tables which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.