pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Koval <d.koval@postgrespro.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17539: Assert after CREATE OPERATOR CLASS command
Date: Tue, 5 Jul 2022 23:36:13 +0300
Message-ID: <48de2fe8-9995-9f0c-b676-400c17d3040f@postgrespro.ru> (raw)
In-Reply-To: <17539-37e89c604ebc0e02@postgresql.org>
References: <17539-37e89c604ebc0e02@postgresql.org>

Attachment: patch

Attachments:

v1-0001-error-instead-assert.patch (text/plain, 1004B) download diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 6b35111ebb6..21b10d29a50 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -673,7 +673,11 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int nparts, /* All partitions must now have been assigned canonical indexes. */ - Assert(next_index == nparts); + if (next_index != nparts) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("not all partitions assigned canonical indexes"))); + return boundinfo; } @@ -888,7 +892,11 @@ create_range_bounds(PartitionBoundSpec **boundspecs, int nparts, boundinfo->indexes[i] = -1; /* All partitions must now have been assigned canonical indexes. */ - Assert(next_index == nparts); + if (next_index != nparts) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("not all partitions assigned canonical indexes"))); + return boundinfo; }

view thread (5+ messages)  latest in thread

Message-ID: <48de2fe8-9995-9f0c-b676-400c17d3040f@postgrespro.ru>
Permalink:  ../48de2fe8-9995-9f0c-b676-400c17d3040f@postgrespro.ru/
Also on:    postgresql.org/message-id/48de2fe8-9995-9f0c-b676-400c17d3040f@postgrespro.ru

 ·  · 

reply

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-bugs@postgresql.org
  Cc: d.koval@postgrespro.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17539: Assert after CREATE OPERATOR CLASS command
  In-Reply-To: <48de2fe8-9995-9f0c-b676-400c17d3040f@postgrespro.ru>

* 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