Re: Typo in PL/pgSQL trigger Example 43.4?

Поиск
Список
Период
Сортировка
Искать
От
Daniel Gustafsson
Тема
Re: Typo in PL/pgSQL trigger Example 43.4?
Дата
Msg-id
CBCF44BE-B598-4E15-9668-E1168DA0C34D@yesql.se
Ответ на
Список
Дерево обсуждения
ODBC options Brad White <b55white@gmail.com>
Re: ODBC options Bruce Momjian <bruce@momjian.us>
Re: ODBC options Brad White <b55white@gmail.com>
Typo in PL/pgSQL trigger Example 43.4? Kirk Parker <khp@equatoria.us>
Re: Typo in PL/pgSQL trigger Example 43.4? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Typo in PL/pgSQL trigger Example 43.4? Tom Lane <tgl@sss.pgh.pa.us>
Re: Typo in PL/pgSQL trigger Example 43.4? Kirk Parker <khp@equatoria.us>
Re: Typo in PL/pgSQL trigger Example 43.4? Daniel Gustafsson <daniel@yesql.se>
Re: Typo in PL/pgSQL trigger Example 43.4? Tom Lane <tgl@sss.pgh.pa.us>
> On 7 Oct 2023, at 22:22, Tom Lane  wrote:
> 
> "David G. Johnston"  writes:
>> On Sat, Oct 7, 2023 at 11:11 AM Kirk Parker  wrote:
>>> INSERT INTO emp_audit SELECT 'D', now(), user, OLD.*; -- <= ARGUMENT IN QUESTION
>>> The emp_audit table has a column named 'userid', which in actual usage
>>> (next-to-last line quoted) is populated by 'user' which seems undefined in
>>> the context.  Was that intended to be 'current_user', or am I missing
>>> something?
> 
>> user is a valid pseudo-function:
>> https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-SESSION
> 
> Yeah, either way has the same result.  However, I wonder if we should
> change this example to use current_user for clarity.  It does look
> more like it's intended to be a variable or column reference than
> a built-in function.

Agreed, and "user" is a hard search term to use for discovering what it is.  +1
for changing to current_user.

--
Daniel Gustafsson



В списке pgsql-docs по дате отправления
От: Kirk Parker
Дата:
От: Vik Fearing
Дата:
FAQ