Re: Can a view use a schema search_path?

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can a view use a schema search_path?
Date: 2012-09-17 13:11:31
Message-ID: CAPTjJmoy3eUV0iOFS10qAVZ9dWkRfy5JfGT1VQbXxSYqiM__XQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 17, 2012 at 7:06 PM, Adam Mackler <adammackler(at)gmail(dot)com> wrote:
> Am I correct in concluding that there's no way to have a single view in the
> public schema that selects data from tables in different other schemas
> depending on my search_path at the time I execute a query involving that
> view?

I don't think so, as I've wanted something similar myself. The easiest
way I found is to create two views, in the same schemas as their
corresponding tables. It's double maintenance but it's cheap to run.

ChrisA

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2012-09-17 13:14:12 Re: Bad pg_dump error message
Previous Message Thomas Kellerer 2012-09-17 12:59:09 Re: Can a view use a schema search_path?