Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4F5EE7E4440 for ; Fri, 22 Jun 2012 09:36:25 -0300 (ADT) Received: from mail-vc0-f174.google.com ([209.85.220.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Si368-0000oh-Eq for pgsql-sql@postgresql.org; Fri, 22 Jun 2012 12:36:24 +0000 Received: by vcbf11 with SMTP id f11so826595vcb.19 for ; Fri, 22 Jun 2012 05:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=GBMD7NEIEf63DW3oLzZ89BaHoYIfPDo7eDq2YXE09JQ=; b=DgX87MQBi372HGCO729gsIiLbX9A04JyQJ/XLgNM3VhpDRCJDcL+HFl3JwfFeqwFLV qGJN4lq4xzVROtfr5qrnv49E2fdnuc36hq1V8Hza1iNuUelGCOLjf967UZIxYNtcJ0Ey 8C7clJbplZLO7Fs4SJ7Bow2pW5Ug4uaz/ZIysyp498pHry4r1CV/riuqp65gVla7WUPZ wNtqM3XVIoUb61Ad/BFHmRNEMZaGiK8bxSqK/O/lLkMBAXkjYbAARJvt3eLER3JrwwLS t11vnvO3dAz+ICVsrgi/OhbFLt3IsUiZApZOf8FcYxuw7rVPStzF0b3ILSOzj3aSJ33y rm2w== Received: by 10.52.26.81 with SMTP id j17mr895893vdg.94.1340368571830; Fri, 22 Jun 2012 05:36:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.72.50 with HTTP; Fri, 22 Jun 2012 05:35:51 -0700 (PDT) In-Reply-To: <4FE458AB.4000109@gmx.net> References: <4FE458AB.4000109@gmx.net> From: Jov Date: Fri, 22 Jun 2012 20:35:51 +0800 Message-ID: Subject: Re: How to limit access only to certain records? To: Andreas Cc: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=20cf307d0386978fea04c30ee0a1 X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201206/73 X-Sequence-Number: 36727 --20cf307d0386978fea04c30ee0a1 Content-Type: text/plain; charset=ISO-8859-1 no,I think there is no such way. what about create view for the user you want to limit,and revoke select privilege from the base table ? 2012/6/22 Andreas > Hi, > > is there a way to limit access for some users only to certain records? > > e.g. there is a customer table and there are account-managers. > Could I limit account-manager #1 so that he only can access customers only > acording to a flag? > > Say I create a relation cu_am ( customer_id, account_manager_id ). > Could I let the database control that account-manager #1 can only see > customers who are assigned to him in the cu_am-relation? > > For now I do this in the front-end but this is easily circumvented for > anyone who has a clue and uses some other client like psql. > > > Regards > Andreas > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/**mailpref/pgsql-sql > --20cf307d0386978fea04c30ee0a1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable no,I think there is no such way.

what about create view for th= e user you want to limit,and revoke select privilege from the base table ?<= br>
2012/6/22 Andreas <<= a href=3D"mailto:maps.on@gmx.net" target=3D"_blank">maps.on@gmx.net>=
Hi,

is there a way to limit access for some users only to certain records?

e.g. there is a customer table and there are account-managers.
Could I limit account-manager #1 so that he only can access customers only = acording to a flag?

Say I create a relation =A0cu_am ( customer_id, account_manager_id ).
Could I let the database control that account-manager #1 can only see custo= mers who are assigned to him in the cu_am-relation?

For now I do this in the front-end but this is easily circumvented for anyo= ne who has a clue and uses some other client like psql.


Regards
Andreas

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
= http://www.postgresql.org/mailpref/pgsql-sql

--20cf307d0386978fea04c30ee0a1--