Re: [GENERAL] What user to defaults execute as? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] What user to defaults execute as?
Date
Msg-id 21202.1036250060@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] What user to defaults execute as?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [GENERAL] What user to defaults execute as?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
I said:
> And I have not yet been able to think of a concrete case where the
> existing behavior (execute as calling user) is better.

Okay, I've thought of one: consider the situation where you want to
label each row in a table with the ID of the user who inserted it.
Right now, you can do...,who    name    default current_user,...
or for greater security use a trigger to set the column value.
This will stop working if defaults and triggers run as the table
owner.  (You could maybe use session_user instead, but it's not
clear that that's the right thing if the user is calling setuid
functions that do things on his behalf.)

However this is only one example; I still think Bruno's got a good
argument.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: move 0 behaviour
Next
From: Bruno Wolff III
Date:
Subject: Re: [GENERAL] What user to defaults execute as?