Re: Can a view use a schema search_path? - Mailing list pgsql-general

From Chris Angelico
Subject Re: Can a view use a schema search_path?
Date
Msg-id CAPTjJmoy3eUV0iOFS10qAVZ9dWkRfy5JfGT1VQbXxSYqiM__XQ@mail.gmail.com
Whole thread Raw
In response to Can a view use a schema search_path?  (Adam Mackler <adammackler@gmail.com>)
Responses Re: Can a view use a schema search_path?  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
On Mon, Sep 17, 2012 at 7:06 PM, Adam Mackler <adammackler@gmail.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


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Can a view use a schema search_path?
Next
From: "David Johnston"
Date:
Subject: Re: Can a view use a schema search_path?