Re: IF- statements in a rule's 'DO INSTEAD SELECT ...'- statement

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: "Bertin, Philippe" <philippe(dot)bertin(at)barco(dot)com>
Cc: <nandrews(at)investsystems(dot)co(dot)uk>, <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IF- statements in a rule's 'DO INSTEAD SELECT ...'- statement
Date: 2002-05-07 15:03:20
Message-ID: Pine.LNX.4.33.0205071050130.9071-100000@polluelo.lab.protecne.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, 7 May 2002, Bertin, Philippe wrote:

Hi Phillippe,

> Thanks for your reply. I indeed already tried with a plpgsql function. But
> that's just my problem : if I call a function from within a view's rule,
> this function is not executed anymore with the same rights as a user had on
> the view. So if a user may access a view, but not the table behind, calling
> a function in the DO INSTEAD- clause will not execute the function with the
> proper (view) rights on the table ...

Oh, sure, you are right.

> (to all) Could anyone - (developers, eventually ?) explain me why the
> (security) context of a function call is not passed along when the function
> gets called from within a view ? I think this feature is for sure not
> superfluous, and I could consider having a look into the code to have this
> changed (but I think this is a VERY big pile of source codes I never ever
> looked at before, so this would take a lot of efforts ... for me)

That feature is added in current CVS I think. Maybe you can look at
current sources and backport the patch.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"La verdad no siempre es bonita, pero el hambre de ella si"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Reyes 2002-05-07 15:04:28 Re: Error with vacuum
Previous Message Scott Marlowe 2002-05-07 15:01:47 Re: Subject: bool / vacuum full bug followup part 2

Browse pgsql-hackers by date

  From Date Subject
Next Message Kovacs Zoltan 2002-05-07 15:57:05 7.1.3: pg_dump hierarchy problem
Previous Message mlw 2002-05-07 14:58:29 Re: OK, lets talk portability.