Received: from degroens.oracom.com (degroens.oracom.com [63.238.138.68]) by postgresql.org (8.11.3/8.11.4) with SMTP id g0GEgIV06950 for ; Wed, 16 Jan 2002 09:42:18 -0500 (EST) (envelope-from gtm@oracom.com) Received: (qmail 21231 invoked from network); 16 Jan 2002 10:58:25 -0000 Received: from unknown (HELO catamount) (192.168.253.253) by 192.168.253.2 with SMTP; 16 Jan 2002 10:58:25 -0000 Message-ID: <013401c19e9c$b3d4f790$4d00a8c0@catamount> From: "Glenn MacGregor" To: Subject: limiting access to (through) views Date: Wed, 16 Jan 2002 09:47:21 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0131_01C19E72.CAF5C7D0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200201/180 X-Sequence-Number: 6266 This is a multi-part message in MIME format. ------=_NextPart_000_0131_01C19E72.CAF5C7D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All, I need to limit access to certain rows of a table. It was suggested to do = this via a view, but it seems to me that I need the current username that i= s logged in to do this. Also I need to get info from another table inorder= to make this work. Can I have multiple selects in a single view using the= output of one in another? Example: table1: col1,col2,col3 table1 Data: test,here,max test1,here1,me test2,here2,one test3,here3,max test4,here4,one test5,here5,two table2: username,key table2 Data: user1,max user2,one user3,two user4,me So I have these two tables, I authenticate and gain access to the db. How = do I know who I am in a query? I need to query table2 for the key of the u= sername I am. Then I need to query table1 for rows that col3 matches the k= ey I got from the previous query. Is this possable with a view? Thanks=20 Glenn ------=_NextPart_000_0131_01C19E72.CAF5C7D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi All,
 
I need to limit access to certain rows of&= nbsp;a=20 table.  It was suggested to do this via a view, but it seems to me tha= t I=20 need the current username that is logged in to do this.  Also I need t= o get=20 info from another table inorder to make this work.  Can I have multipl= e=20 selects in a single view using the output of one in another?
 
Example:
 
    table1:
       = =20 col1,col2,col3
 
    table1 Data:
       =20 test,here,max
       =20 test1,here1,me
       =20 test2,here2,one
       =20 test3,here3,max
       =20 test4,here4,one
       =20 test5,here5,two
 
    table2:
        username,key
 
    table2 Data:
        user1,max
        user2,one
        user3,two
        user4,me
 
So I have these two tables, I authenticate and gain access to the db.&= nbsp;=20 How do I know who I am in a query?  I need to query table2 for the key= of=20 the username I am.  Then I need to query table1 for rows that col3 mat= ches=20 the key I got from the previous query.
 
Is this possable with a view?
 
    Thanks
 
           =20 Glenn
------=_NextPart_000_0131_01C19E72.CAF5C7D0--