Re: Fix incorrect column name in error message for range partition bound check - Mailing list pgsql-hackers

From David Rowley
Subject Re: Fix incorrect column name in error message for range partition bound check
Date
Msg-id CAApHDvodF8tCH4U+5ubY=SKubBbeH-OmruMt2Pp74k3y9SPn9w@mail.gmail.com
Whole thread Raw
In response to Fix incorrect column name in error message for range partition bound check  (myzhen <zhenmingyang@yeah.net>)
List pgsql-hackers
On Wed, 7 Jan 2026 at 18:45, myzhen <zhenmingyang@yeah.net> wrote:
> postgres=# CREATE TABLE pt_test_colname(a int, b int, c int) PARTITION BY RANGE(a, b);

> -- wrong case
> postgres=# CREATE TABLE pt_test_colname_p1 PARTITION OF pt_test_colname FOR VALUES FROM (minvalue, now()) TO (100,
100);
> ERROR: specified value cannot be cast to type integer for column "a"
> LINE 1: ...ION OF pt_test_colname FOR VALUES FROM (minvalue, now()) TO ...

(I thought I'd sent this email last week, but I don't see it in the
archives or my sent items)

I've pushed a fix similar to your v1 patch for this.  I used
foreach_current_index rather than what you did in your v1. That seems
less prone to get broken again in the future if someone were to add
additional logic within the loop body.

I didn't see any need to do any more than that, so I didn't consider
anything your v2 patch did.

Thanks for the patch.

David



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: Chao Li
Date:
Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables