Combining metavariables and table names

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: H <agents(at)meddatainc(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Combining metavariables and table names
Date: 2025-12-30 03:28:09
Message-ID: CAKFQuwYjqQr69HnUzSmEdnSPGrbFe2vX-u3umtukz533-0X4Tw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday, December 29, 2025, H <agents(at)meddatainc(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2025-12-30 05:26:53 Re: psql: print values and return the COUNT(*) value to bash?
Previous Message H 2025-12-30 03:02:20 Re: Combining metavariables and table names