pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: mpg4@duluoz.net
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Getting environment variables?
Date: Sun, 16 Jan 2000 18:13:34 +0100 (CET)
Message-ID: <Pine.LNX.4.21.0001151952060.386-100000@localhost.localdomain> (raw)
In-Reply-To: <20000113022552.30106.qmail@paradise.duluoz.net>

On 2000-01-12, mpg4@duluoz.net mentioned:

>    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.

I don't see this working out. Somehow you'd have to get the information on
the server host, there's no official way to abuse the PostgreSQL
connection for other purposes.

> 
>    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
> 
> 

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden





view thread (2+ messages)

Message-ID: <Pine.LNX.4.21.0001151952060.386-100000@localhost.localdomain>
Permalink:  ../Pine.LNX.4.21.0001151952060.386-100000@localhost.localdomain/
Also on:    postgresql.org/message-id/Pine.LNX.4.21.0001151952060.386-100000@localhost.localdomain

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: peter_e@gmx.net, mpg4@duluoz.net
  Subject: Re: [SQL] Getting environment variables?
  In-Reply-To: <Pine.LNX.4.21.0001151952060.386-100000@localhost.localdomain>
  References: <20000113022552.30106.qmail@paradise.duluoz.net> <Pine.LNX.4.21.0001151952060.386-100000@localhost.localdomain>

* 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