Re: dynamic views

From: Richard Huxton <dev(at)archonet(dot)com>
To: sferriol <sylvain(dot)ferriol(at)imag(dot)fr>, pgsql-general(at)postgresql(dot)org
Subject: Re: dynamic views
Date: 2004-02-24 16:59:04
Message-ID: 200402241659.04307.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 24 February 2004 16:29, sferriol wrote:
> hello
> is it possible with postgres 7.2 or more, to define a dynamic view.
> For example, i have a table with a column 'user'
> and i want to define a view which gives infomrations from different
> tables but the user has to specifie the 'user' parameter when using a
> select to the view

You can have a view something like:

SELECT * FROM personal_info WHERE owner = CURRENT_USER;

There are some other vars/functions too SESSION_USER and current_database()
etc.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Shanny 2004-02-24 17:03:54 Re: Found this in the server log on MAC OSX
Previous Message Paul Simpson 2004-02-24 16:40:27 Re: Why does app fail?