Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vaO76-007jTZ-1n for pgsql-general@arkaria.postgresql.org; Tue, 30 Dec 2025 01:01:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vaO74-001Lpw-2B for pgsql-general@arkaria.postgresql.org; Tue, 30 Dec 2025 01:01:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vaO74-001Lpn-1A for pgsql-general@lists.postgresql.org; Tue, 30 Dec 2025 01:01:27 +0000 Received: from mout.perfora.net ([74.208.4.194]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vaO73-003GC1-2N for pgsql-general@lists.postgresql.org; Tue, 30 Dec 2025 01:01:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meddatainc.com; s=s1-ionos; t=1767056484; x=1767661284; i=agents@meddatainc.com; bh=BJx68Ilzpm2/6y8rpiGg46uvzSrmnZoz3ag+GwD8BzI=; h=X-UI-Sender-Class:Date:In-Reply-To:References:MIME-Version: Content-Type:Content-Transfer-Encoding:Subject:To:From:Message-ID: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=a6mWuISln5+pGUlSYY+SCNt5mUghKreTfbSdXuyVSJZfo914QQCcu/ty1HmJkx5T t/XjBiU35eHDCl74yHtr9HaekQJgO62uVwfJrmrCGZuIDzWxTnIme7A+CyKKB0w6R f/4EvsuyBmuvxkOGwgD8lIslgontcXQLkY1JBoToRxgcT+ye22Oab37Gu6L39Gwos j1jkOOU7WHv8sbl+ARCf/mdl1nZQxNku+Fo1UkZC5yKhjsPqD1FHtKWswGtALnMll Rd9nHNQB2dIzQrZshk7wq8wNfVoVdVFz4U+qQyQgT0/q5VMeOakjxibzeIJZgU79I A/e6fhQJppProBTjoQ== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from [10.120.190.106] ([166.170.34.239]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0Me96G-1vHEPC2F4w-00Y5Uh for ; Tue, 30 Dec 2025 02:01:24 +0100 Date: Mon, 29 Dec 2025 20:01:21 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <2743391.1766979679@sss.pgh.pa.us> References: <8254F175-871C-4678-8D28-A67E09B099A6@meddatainc.com> <2743391.1766979679@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Combining metavariables and table names To: pgsql-general@lists.postgresql.org From: H Message-ID: <60F4B5CE-F983-4174-A141-0C755284CDFD@meddatainc.com> X-Provags-ID: V03:K1:i/cyMSegb0EotxgyKgZWPbPIf1um78domNt6pqtqs4WXb9BxR7x V2BaV8eLVbayOSTF0vyQi14IZjTsTHJlijI8H6cmIXUCOhsLcDnUq/z1bBPpM6dw9gUcS2W lEAryta4eqtI0h8xYrb+qrfnApxxFdhmJA/rg/LAKz0H1POEzJ1UeCyHKbTDu3/fXbbs3ET GSl9FxrnShPEp2c3/o/ew== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:13Jcm0et3To=;VTWSE5tDI07VYDPhsgWGoKToPj0 MaCWmx9toXcp644a5dujb4oAuVJ40onSdDsPfm/mFsUZNU3ZloNQVgR8cic71fwHT/Zo7mTYO uOOl9b0mD4m/1COFOyIGukNGO+Dw65vIibumqhovVy587eAWGaYbx1CZyYnTmE8lZT/3hdElt 9w+dcQryE3XNiEoDmHy7auNGQtTwZjhjTVpZcotVfgKkTPYxBVRbPGcP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1mYWXf64BQoU566qs0Mr32GUP SjFEy5QljneN+YaSSHR2LsPNI75iSyO4gAIHm2qKqO6Ra3Qb8VMfsMepXITBkD56/3+3sO7F/ NHzjklvkCREC7b3Zu93maDPTu1lRdwWuOsaweH9WcGZgaijuhKJHqSaFjycXgJ3dLkCJpg/eW m+V8kR0nF2ACvk+c9eDBhu4sjPgxMFceCKAcsriqKpLR+U+wmiDAvGkxX4ELCrdKSzUotvk80 8l5eAy82FrJMAHGo7HdiCkTRs/VACd1tM1hnKzRuD59DUAdPPxjt0rZy560Vs2Z00GXay4BiG xLndOG/sXmOUP41jcXgCEBXMeC/2yML0KoKYYdOqwCiLcF0Gzpas9cdJNYZuTGZCaMudXn/zU O5uGQGkRPSazS+NifdULOQEwesolgnyw4Gjyt3wrcyml7QqTimBAr5o3LJJFv8SjanHq2yRB9 qcwWHBtUvERwtPxges8ixBTquiQt4q3MUhQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On December 28, 2025 10:41:19 PM EST, Tom Lane wr= ote: >"David G=2E Johnston" writes: >> On Sunday, December 28, 2025, H wrote: >>> I have a feeling I might be missing how to use the combination of a >>> metavariable and a table name when used in an argument to a >procedure=2E > >> No, what you are doing is impossible if you limit yourself to direct >SQL >> command syntax writing=2E > >Yeah :-( > >> I=E2=80=99d probably do something like: >> versioning(=E2=80=A6, format(=E2=80=98%I=2E%I=E2=80=99, :=E2=80=99s=E2= =80=99, =E2=80=98test_history=E2=80=99), =E2=80=A6) > >The reason this is hard is that we don't support expressions in >CREATE TRIGGER, only simple literals=2E So any such processing would >have to be done in the client-side code that is sending the command, >and I don't think psql's variable-substitution ability is quite up >to the job=2E > >You might be able to make it work through the hacky method of >supplying the schema name and table name as separate trigger >arguments=2E > >Another idea could be to construct the desired string as a SELECT >result, and then use \gexec=2E There's a few too many moving parts >in that for my taste, but maybe it could work=2E > > regards, tom lane That would explain it! I now see that when I read the CREATE TRIGGER docum= entation=2E I will use the workaround I found, ie=2E generating a literal string in an= other meta variable=2E It would be nice if this would be considered a reque= st for an enhancement?