From: Dado Feigenblatt <dado@wildbrain.com>
To: pgsql-sql@postgresql.org
Subject: creating variable views
Date: Fri, 29 Jun 2001 12:29:33 -0700
Message-ID: <3B3CD71D.D35F928@wildbrain.com> (raw)
References: <200106291855.f5TItja06398@postgresql.org>
Hi. New to the list.
I'm building a database that will hold data for many different projects.
Some people, or groups of people, will have access to just the rows of data of their
projects.
Some are very granular. Let's use for this example the data about the people itself.
Other than the administrators, I want people to see only their own data.
Instead of creating a view for each person, is it possible to create a single view with
variable data?
CREATE VIEW user_info AS
SELECT * FROM users
WHERE user_name = pg_user
where pg_user is the user name that person used to log into the database.
Is there a way to get the user name in Postgresql?
Even if the variable pg_user is not available,
is it possible to create views using variables like that?
Thanks.
--
Dado Feigenblatt Wild Brain, Inc.
Technical Director (415) 553-8000 x???
dado@wildbrain.com San Francisco, CA.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dado@wildbrain.com
Subject: Re: creating variable views
In-Reply-To: <3B3CD71D.D35F928@wildbrain.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox