Combining metavariables and table names - Mailing list pgsql-general

From David G. Johnston
Subject Combining metavariables and table names
Date
Msg-id CAKFQuwYjqQr69HnUzSmEdnSPGrbFe2vX-u3umtukz533-0X4Tw@mail.gmail.com
Whole thread Raw
In response to Re: Combining metavariables and table names  (H <agents@meddatainc.com>)
List pgsql-general
On Monday, December 29, 2025, H <agents@meddatainc.com> wrote:

I used the exact syntax you provided, however, I suspect that format() cannot be used in an argument in CREATE TRIGGER.

Oh, right.  I was apparently overlooking the context and got tunnel vision around the “versioning” function call that isn’t really a call but rather a stored expression; and so the arguments must be simple literals (as documented).

In that case you do indeed need to do the work in the client since the server needs the final result handed to it.

You could also just create a wrapper function that calls versioning and has the two name part arguments as separate inputs.

David J.

pgsql-general by date:

Previous
From: H
Date:
Subject: Re: Combining metavariables and table names
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: psql: print values and return the COUNT(*) value to bash?