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 4075780
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:20:31+00:00 2026-05-20T17:20:31+00:00

I want to create a test environment where the basic underlying postgres database is

  • 0

I want to create a test environment where the basic underlying postgres database is overlain with an instance-localized private view, such that all queries from a specific set of processes go through the private view while other (potentially concurrent or merely subsequent) processes would remain unaffected.

I think I can do something like this using the search_path mechanism, but it’s not clear if I can do that transparently (e.g., without having each application execute some set of SQL setup for each connection). For example, is there something I could set as an environment variable saying “use this search_path” and have every process that I start thereafter see that and use the same private table instances?

If it matters, the processes are all going through the C++ adapter, libpqxx, to access the database.

Thanks,
Jeff

  • 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-05-20T17:20:32+00:00Added an answer on May 20, 2026 at 5:20 pm

    If every instance has a separate database user role, you can simply create a schema with the same name as the user and it’ll use it — without any change to configuration:

    myuser=> show search_path;
     search_path   
    --------------
    "$user",public
    (1 row)
    
    myuser=> create schema myuser;
    CREATE SCHEMA
    myuser=> create table foo(i int);
    CREATE TABLE
    myuser=> \d foo
       Table "myuser.foo"
    Column  Type   Modifiers 
    ------ ------- ---------
    i      integer 
    

    If you want to have different names for users and schemas, you can configure it for each user manually:

    ALTER USER foo SET search_path=foo_schema;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use php in console mode and create an environment to test
<flavor> I want to create a spelling test program for my grade schoolers that
I have some kind of test data and want to create a unit test
I want to create a SQL Select to do a unit test in MS
If you want to create a custom attribute for MS test (say [Repeat(3)] how
I want to test the web pages I create in all the modern versions
I want to create a function that performs a function passed by parameter on
I want to learn Ruby on Rails and have set up a test environment.
I want create a drop shadow around the canvas component in flex. Technically speaking
I want to create a Java application bundle for Mac without using Mac. According

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.