Re: Typo in PL/pgSQL trigger Example 43.4?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Kirk Parker <khp(at)equatoria(dot)us>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Typo in PL/pgSQL trigger Example 43.4?
Date: 2023-10-07 18:15:34
Message-ID: CAKFQuwZW2qTAavt8R1c20wW_OOn9YZ9Eoz4oc8jy3+Y2en0keQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Sat, Oct 7, 2023 at 11:11 AM Kirk Parker <khp(at)equatoria(dot)us> 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

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2023-10-07 20:22:01 Re: Typo in PL/pgSQL trigger Example 43.4?
Previous Message Kirk Parker 2023-10-07 18:10:28 Typo in PL/pgSQL trigger Example 43.4?