Re: views to behave differently according to user and schema

From: Richard Huxton <dev(at)archonet(dot)com>
To: Samuel Thoraval <samuel(dot)thoraval(at)librophyt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: views to behave differently according to user and schema
Date: 2005-08-03 11:51:05
Message-ID: 42F0AFA9.4000202@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Samuel Thoraval wrote:
>
> Is it possible to change this behavior so that the VIEW will dynamically
> use the search_path variable (when the schema was not specifically set) ?
> In this case, when user nsp2 loggs in, the VIEW vtest would be using
> VIEW nsp2.test, when user nsp3 loggs in it would use VIEW nsp3.test, for
> user nsp1 TABLE nsp1.test ...

I don't think so. There's no guarantee that nsp1 and nsp2 have the same
definition, which means the view could break depending on search_path.

You could create a separate view in each schema of course.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-08-03 12:15:38 Re: Hello
Previous Message Vahe Ghorghorian 2005-08-03 11:47:43 Hello