Re: Replace run-time error check with assertion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Replace run-time error check with assertion
Date: 2021-05-25 14:51:23
Message-ID: 1210610.1621954283@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> In the attached patch, the error message was checking that the
> structures returned from the parser matched expectations. That's
> something we usually use assertions for, not a full user-facing error
> message. So I replaced that with an assertion (hidden inside
> lfirst_node()).

Works for me. It's certainly silly to use a translatable ereport
rather than elog for this.

Localizing those variables some more looks sane too.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-05-25 15:20:26 Re: CALL versus procedures with output-only arguments
Previous Message Tom Lane 2021-05-25 14:29:14 Re: pg_rewind fails if there is a read only file.