Re: pl/pgsql enabled by default

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pl/pgsql enabled by default
Date: 2005-05-09 03:48:10
Message-ID: 87y8aprret.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mike Mascari <mascarm(at)mascari(dot)com> writes:

> 2. Issue a query like:
>
> SELECT *
> FROM view_of_salaries_based_on_current_user
> WHERE my_side_effect_function_that_inserts_into_a_temp_table(salary, employee);

That's just exactly equivalent to

SELECT *
FROM (select *
from all_salaries
where user = CURRENT_USER
)
WHERE malicious_function(salary,employee)

Hm. If you incorrectly mark your function as IMMUTABLE even though it has side
effects then the planner may indeed collapse this. Does the planner know it
can't collapse views if the underlying tables aren't accessible to the user?

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2005-05-09 03:52:35 Re: [HACKERS] read-only database
Previous Message Satoshi Nagayasu 2005-05-09 03:48:02 Re: [HACKERS] read-only database