pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Petr Kavan <petr.kavan@marekmicro.cz>
Cc: pgsql-performance@postgresql.org
Subject: Re: How many views is ok?
Date: Sun, 14 Aug 2005 20:38:00 -0400
Message-ID: <5059.1124066280@sss.pgh.pa.us> (raw)
In-Reply-To: <001a01c59f0a$8e8d9560$de01a8c0@kavan>
References: <001a01c59f0a$8e8d9560$de01a8c0@kavan>

"Petr Kavan" <petr.kavan@marekmicro.cz> writes:
> Possibility is to create a view for each employee that chooses only his data 
> and give employee privileges to this view. But I am not sure if such number 
> of views does not have some performance drawbacks or even if postgre can 
> support it (I expect i can).

Do you really need more than one view?  I'd consider something like

	create view emp_view as select * from emp where name = current_user;

This requires that your Postgres usernames match up with something in
the underlying table, of course.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <5059.1124066280@sss.pgh.pa.us>
Permalink:  ../5059.1124066280@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5059.1124066280@sss.pgh.pa.us

 · 

reply

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, petr.kavan@marekmicro.cz
  Subject: Re: How many views is ok?
  In-Reply-To: <5059.1124066280@sss.pgh.pa.us>

* 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