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

From Mike Mascari
Subject Re: pl/pgsql enabled by default
Date
Msg-id 427D7787.90507@mascari.com
Whole thread Raw
In response to Re: pl/pgsql enabled by default  (Neil Conway <neilc@samurai.com>)
Responses Re: pl/pgsql enabled by default
Re: pl/pgsql enabled by default
Re: pl/pgsql enabled by default
List pgsql-hackers
Neil Conway wrote:
> Mike Mascari wrote:
> 
>> People who use views to achieve row security, which is a rather common 
>> paradigm, cannot allow users to create functions with side effects.
> 
> 
> Can you elaborate? I'm not sure I follow you.
> 
> (I'll note anyway that (1) SQL functions can have side effects: CREATE 
> FUNCTION foo() RETURNS VOID AS 'DELETE FROM ...', for example 

Wow. That's a problem IMHO. Many people use views to allow userA to 
query his salary without seeing userB's. If userA can just:

1. Create a SQL function which inserts into another table its arguments

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

and that function is writable with just 'SQL', then many, many people 
have a serious security risk on their hands. Perhaps this is why 
Oracle's standard UDFs cannot perform inserts, updates, or deletes.

Mike Mascari


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: pl/pgsql enabled by default
Next
From: Tatsuo Ishii
Date:
Subject: Re: Race conditions, race conditions!