From: Erik Wienhold <ewie@ewie.name>
To: Florian Koch <florian.murat.koch@gmail.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: I get ERROR: column "table_name" does not exist
Date: Fri, 7 Jun 2024 03:24:19 +0200
Message-ID: <f1d6eec7-1b52-4103-944b-b633b56d34a8@ewie.name> (raw)
In-Reply-To: <CAHxsHhwb1W1jdBaA3=UbS9dz6nOvzVRVqCGh6qYKPpz3=jL3aw@mail.gmail.com>
References: <171753061515.2021730.14624637049210791754@wrigleys.postgresql.org>
<26d7c4dd-2809-426a-acb4-bbd2828fba93@ewie.name>
<CAHxsHhwb1W1jdBaA3=UbS9dz6nOvzVRVqCGh6qYKPpz3=jL3aw@mail.gmail.com>
On 2024-06-06 15:08 +0200, Florian Koch wrote:
> This is the working example, when I replace any of e.g.
> 'PG_EXCEPTION_HINT' with 'TABLE_NAME'. Then the function throws. I am
> using postgres 16.1.
Perhaps you did not declare variable table_name and run something like:
RETURN jsonb_build_object('table', table_name);
But that's still guesswork without seeing the actual function definition
with your edits.
> On Wed, Jun 5, 2024 at 6:32 PM Erik Wienhold <ewie@ewie.name> wrote:
> >
> > On 2024-06-04 21:50 +0200, PG Doc comments form wrote:
> > > When using GET STACKED DIAGNOSTICS in PL/pgSQL accessing TABLE_NAME,
> > > COLUMN_NAME, CONSTRAINT_NAME or SCHEMA_NAME throws an error.
> > >
> > > The function "shared.test_raise_exception":
> > > https://github.com/rin-nas/postgresql-patterns-library/issues/8#issuecomment-2147984520
> >
> > * Do you have a reproducer with those diagnostic items? The linked
> > script does not use any of the items that you've mentioned.
> >
> > * Which Postgres version?
--
Erik
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: pgsql-docs@postgresql.org
Cc: ewie@ewie.name, florian.murat.koch@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: I get ERROR: column "table_name" does not exist
In-Reply-To: <f1d6eec7-1b52-4103-944b-b633b56d34a8@ewie.name>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox