Received: from paradise.duluoz.net (IDENT:qmailr@[206.58.39.200]) by hub.org (8.9.3/8.9.3) with SMTP id VAA93593 for ; Wed, 12 Jan 2000 21:25:53 -0500 (EST) (envelope-from mpg4@duluoz.net) From: mpg4@duluoz.net Received: (qmail 30107 invoked by uid 500); 13 Jan 2000 02:25:52 -0000 Message-ID: <20000113022552.30106.qmail@paradise.duluoz.net> Subject: Getting environment variables? To: pgsql-sql@postgresql.org Date: Wed, 12 Jan 2000 18:25:52 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit All- I'd like to be able to create a view like this: create view my_view as select * from real_table where check_cred(row.id) where check_cred(row.id) is a function that checks for some externally available credential or 'ticket' and only shows the rows in the table that the id is allowed to see. Basically, I want to create 'virtual users' inside of my database without creating a separate view for each user. My problem is getting check_cred() to see the 'ticket' without having it passed in with the query. Environment variables won't workas the backend executes the query, and doesn't have my environment. Some client/server thing would work, I suppose, but I don't really want to code one if it can be avoided. Is there an easier solution? Also, is there a repository for user-created postgresql types/functions anywhere? Some of the things I'm doing have to have been done already, and done better. Thanks, -mike -- And though the holes were rather small They had to count them all Now they know how many holes it takes to fill the Albert Hall *I'd love to turn you on* -- Beatles, "A Day in the Life" GnuPG key available at http://devel.duluoz.net/pubkey.asc Key ID = 1024D/9A256AE5 1999-11-13 Mike Glover Key fingerprint = EF6E 8BCB 4810 E98C F0FD 4596 367A 32B7 9A25 6AE5