Re: Internal error codes triggered by regression tests and user queries, take 2

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>
Subject: Re: Internal error codes triggered by regression tests and user queries, take 2
Date: 2026-10-17 11:00:00
Message-ID: f2758799-b7c1-4baf-8593-8899802cf48c@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Michael and Tom,

22.09.2026 13:49, Michael Paquier wrote:
> As a whole, that looks OK, so applied on HEAD. I did not look at
> 0002.

Let me share the following set of other internal errors:
1)
CREATE TABLE t AS SELECT ''::text a;
CREATE INDEX brinidx ON t USING brin
  (a text_bloom_ops(n_distinct_per_range = -1.0));

ERROR:  XX000: the bloom filter is too large (44629 > 8144)
LOCATION:  bloom_init, brin_bloom.c:
-> ERRCODE_PROGRAM_LIMIT_EXCEEDED

2)
SELECT pg_identify_object_as_address('1'::regclass, 1, 1);

ERROR:  XX000: unsupported object class: 1
LOCATION:  getObjectTypeDescription, objectaddress.c:4731
-> ERRCODE_INVALID_PARAMETER_VALUE

3)
SELECT pg_get_acl('1'::regclass, 1, 0);

ERROR:  XX000: unrecognized class ID: 1
LOCATION:  get_object_property_data, objectaddress.c:2821
-> ERRCODE_INVALID_PARAMETER_VALUE

4)
SELECT jsonb_to_tsvector('{}', '[{}]'::jsonb);

ERROR:  XX000: unexpected end of flag array
LOCATION:  parse_jsonb_index_flags, jsonfuncs.c:5614
-> ERRCODE_INVALID_PARAMETER_VALUE

5)
CREATE PROCEDURE p(INOUT a integer) LANGUAGE sql
  AS 'SELECT 1 WHERE false;';
CALL p(1);

ERROR:  XX000: procedure returned null record
LOCATION:  ExecuteCallStmt, functioncmds.c:2351
-> ERRCODE_INVALID_OBJECT_DEFINITION

6)
CREATE EXTENSION dblink;
CREATE FUNCTION connection_parameters() RETURNS text LANGUAGE SQL AS
  $f$ SELECT $$dbname='$$||current_database()||$$' port=$$||current_setting('port'); $f$;
SELECT dblink_connect('myconn',connection_parameters());
SELECT * FROM dblink_send_query('myconn', 'SELECT 1');
SELECT * FROM dblink('myconn', 'SELECT 2') AS t(i int);

ERROR:  XX000: could not send query: another command is already in progress
LOCATION:  storeQueryResult, dblink.c:1103
-> ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE

Please look at the attached patch which defines these error codes.

Best regards,
Alexander

Attachment Content-Type Size
Define-missing-errcodes-2.patch text/x-patch 3.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2026-10-17 11:01:29 Re: Reject COPY TO of unlogged relations during recovery
Previous Message Pierre Forstmann 2026-10-17 10:15:59 Re: regress: query discrepancy between explain vs execution