Re: errposition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: errposition
Date: 2026-05-08 04:32:54
Message-ID: 921810.1778214774@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

John Naylor <johncnaylorls(at)gmail(dot)com> writes:
> In doc/src/sgml/sources.sgml under "available auxiliary routines for
> ereport", we have

> "errposition(int cursorpos) specifies the textual location of an error
> within a query string. Currently it is only useful for errors detected
> in the lexical and syntactic analysis phases of query processing."

> ...but I don't see that function used that way. It seems this should
> be parser_errposition instead. I'll go make it so unless someone tells
> me I'm missing something.

errposition is the underlying function exposed by elog.c, and
that is what this documentation is intending to document.
parser_errposition is a wrapper that is specific to usages in
src/backend/parser/. It might be (I didn't check) that all existing
calls to errposition go through parser_errposition, but that seems
like a happenstance not a reason to contort the documentation.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2026-05-08 04:40:01 Re: Bug: trailing comma syntax error in postgres_fdw fetch_attstats()
Previous Message Fujii Masao 2026-05-08 04:31:01 Re: [Patch] Omit virtual generated columns from test_decoding output