Received: from degroens.oracom.com (degroens.oracom.com [63.238.138.68]) by postgresql.org (8.11.3/8.11.4) with SMTP id g0GFrqV29356 for ; Wed, 16 Jan 2002 10:53:52 -0500 (EST) (envelope-from gtm@oracom.com) Received: (qmail 23599 invoked from network); 16 Jan 2002 12:08:46 -0000 Received: from unknown (HELO catamount) (192.168.253.253) by 192.168.253.2 with SMTP; 16 Jan 2002 12:08:46 -0000 Message-ID: <01c201c19ea6$b40ec0b0$4d00a8c0@catamount> From: "Glenn MacGregor" To: "Stephan Szabo" Cc: References: <20020116074331.G44027-100000@megazone23.bigpanda.com> Subject: Re: limiting access to (through) views Date: Wed, 16 Jan 2002 10:58:56 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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/188 X-Sequence-Number: 6274 Stephan, Thanks again. The CURRENT_USER function returns just the username, my table actually has username@server. Glenn ----- Original Message ----- From: "Stephan Szabo" To: "Glenn MacGregor" Cc: Sent: Wednesday, January 16, 2002 10:44 AM Subject: Re: [SQL] limiting access to (through) views > > On Wed, 16 Jan 2002, Glenn MacGregor wrote: > > > Thanks, > > > > Now is it possible to do the following: > > > > select table1.* from > > table1, table2 where > > table1.col3=table2.key and > > table2.username like 'CURRENT_USER%' > > > > This is returning nothing when I know it should be returning something, so I > > think that since the CURRENT_USER is in the ' it is not executing the > > function. Is there a way to make that execute using the like with the regex > > matching (%)? > > Do you really want a like search or are you trying to get around it not > matching something? > table2.username like CURRENT_USER || '%' would probably work. > >