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 have a test environment for a database that I want to reload with
I want to create NUnit test to ensure that my function does not throw
I want to use php in console mode and create an environment to test
I want to create a unit test for integration testing. What class should I
I want to create SQL function with JDBC CREATE OR REPLACE FUNCTION TEST.TO_STRING( nt_in
I have a method CreateAccount(...) that I want to unit test. Basically it creates
I want create wordpress website into which I want create user management... That means
i want create a custom json data from the mssql 2008 results so that
I want to learn Ruby on Rails and have set up a test environment.
I want to create database import using .sql file with java then I found

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.