pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wieck@debis.com
To: stevew@bigeric.force9.co.uk
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Function security?
Date: Wed, 16 Jun 1999 12:50:43 +0200 (MET DST)
Message-ID: <m10uDHH-0003kLC@orion.SAPserv.Hamburg.dsh.de> (raw)
In-Reply-To: <172087791.961422.83@erica>

>
> I wish to control access to some tables, so I do not want to grant
> select to all users. Instead I would like to use some functions which
> return the info.
>
> So I have some tables owned by admin
> I have a user who does not have select permission on the tables owned by
> admin.
> admin has created some functions which perform some selects on admin's
> tables.
> When user runs these functions, user gets permission denied.
>
> Is there a way to let the user be admin when running the functions ????
>
> You can do this with Oracle.

    PostgreSQL  doesn't support this kind of SETUID for functions
    or trigger procedures up to now (there are plans to do so but
    it didn't make it for v6.5).

    You  could  use  a  view instead, which presents the data you
    want to make accessible, and grant the  required  permissions
    on  the view.  The view should not contain any function calls
    that internally do  their  own  queries  (usually  over  SPI)
    because  these  function  internal queries are again executed
    under the current users permissions and would probably  fail.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #





view thread (3+ messages)

Message-ID: <m10uDHH-0003kLC@orion.SAPserv.Hamburg.dsh.de>
Permalink:  ../m10uDHH-0003kLC@orion.SAPserv.Hamburg.dsh.de/
Also on:    postgresql.org/message-id/m10uDHH-0003kLC@orion.SAPserv.Hamburg.dsh.de

 · 

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: wieck@debis.com, stevew@bigeric.force9.co.uk
  Subject: Re: [SQL] Function security?
  In-Reply-To: <m10uDHH-0003kLC@orion.SAPserv.Hamburg.dsh.de>
  References: <172087791.961422.83@erica> <m10uDHH-0003kLC@orion.SAPserv.Hamburg.dsh.de>

* 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