Re: Improving PL/Tcl's error context reports

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improving PL/Tcl's error context reports
Date: 2024-07-04 19:42:49
Message-ID: 78188.1720122169@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> PLpgSQL uses more often function signature
>> (2024-07-04 19:49:20) postgres=# select bx(0);
>> ERROR: division by zero
>> CONTEXT: PL/pgSQL function fx(integer) line 1 at RETURN
>> PL/pgSQL function bx(integer) line 1 at RETURN

> Oh that's a good idea! So let's use format_procedure(), same as
> plpgsql does, to generate the final context line that currently
> reads like

> in PL/Tcl function "bogus"

> Then, we could apply the "pull out just alphanumerics" rule to
> the result of format_procedure() to generate the internal Tcl name.
> That should greatly reduce the number of cases where we have duplicate
> internal names we have to unique-ify.

Here's a v2 that does it like that.

regards, tom lane

Attachment Content-Type Size
better-pltcl-context-reports-v2.patch text/x-diff 31.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Said Assemlal 2024-07-04 20:18:11 Re: CREATE OR REPLACE MATERIALIZED VIEW
Previous Message Florents Tselai 2024-07-04 18:48:26 Re: Update platform notes to build Postgres on macos