public inbox for [email protected]
help / color / mirror / Atom feedFrom: H <[email protected]>
To: [email protected]
Subject: Re: Combining metavariables and table names
Date: Mon, 29 Dec 2025 22:02:20 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwY5UK0YFi2yE1TBigQDK+Mh=jjzDfh9CLhPvNxN3e2nLA@mail.gmail.com>
References: <[email protected]>
<CAKFQuwb9jdGH6-og4HFQv=AU7UH+V2AjoQy2y+xZ_Cjz1bx5FA@mail.gmail.com>
<[email protected]>
<CAKFQuwY5UK0YFi2yE1TBigQDK+Mh=jjzDfh9CLhPvNxN3e2nLA@mail.gmail.com>
On December 29, 2025 8:17:37 PM GMT-05:00, "David G. Johnston" <[email protected]> wrote:
>On Mon, Dec 29, 2025 at 5:58 PM H <[email protected]> wrote:
>
>> Just tried your suggestion to use format() but it resulted in a
>'syntax
>> error at or near "("'
>>
>
>Helps to show exactly what you tried. I provided pseudo-code.
>
>postgres=# \set sch 'schemaname'
>postgres=# select format('%I.%I', :'sch', 'tblname');
> format
>--------------------
> schemaname.tblname
>(1 row)
>
>Admittedly, if the names do require quoting, and depending on how the
>function uses the value, some additional tweaking may be required.
>
>There shouldn't be anything you cannot do with format that you can do
>with
>pre-processing and setting the variable up-front. Admittedly that is
>probably cleaner overall anyway though.
>
>David J.
I used the exact syntax you provided, however, I suspect that format() cannot be used in an argument in CREATE TRIGGER.
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Combining metavariables and table names
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox