Re: pl/pgsql enabled by default - Mailing list pgsql-hackers

From Greg Stark
Subject Re: pl/pgsql enabled by default
Date
Msg-id 87y8aprret.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: pl/pgsql enabled by default  (Mike Mascari <mascarm@mascari.com>)
Responses Re: pl/pgsql enabled by default
List pgsql-hackers
Mike Mascari <mascarm@mascari.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



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: [PATCHES] Cleaning up unreferenced table files
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Cleaning up unreferenced table files