Re: Is a SERIAL column a "black box", or not?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is a SERIAL column a "black box", or not?
Date: 2006-05-02 03:01:58
Message-ID: 22572.1146538918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> One argument against it is that it'd break trying to log who-did-what
>> by the expedient of having a column default CURRENT_USER:
>> blame_me text default current_user

> No reason there couldn't be a separate function that returns the _actual_ user
> rather than the effective user.

... except that the SQL spec says the above should work. In any case,
if you're thinking of SESSION_USER, that's not really the right thing
either. Imagine that the INSERT is being executed by a SECURITY DEFINER
function --- the owner of the function, not the session user, is really
the one that should be "blamed" with the insert.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brandon Black 2006-05-02 05:27:10 Re: Constraint Exclusion + Joins?
Previous Message Jonah H. Harris 2006-05-02 02:26:33 Re: InsertXLogFile in pg_resetxlog