Re: Fix incorrect column name in error message for range partition bound check

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: myzhen <zhenmingyang(at)yeah(dot)net>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fix incorrect column name in error message for range partition bound check
Date: 2026-01-12 02:45:42
Message-ID: CAApHDvodF8tCH4U+5ubY=SKubBbeH-OmruMt2Pp74k3y9SPn9w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 7 Jan 2026 at 18:45, myzhen <zhenmingyang(at)yeah(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-01-12 02:45:55 Re: docs: clarify ALTER TABLE behavior on partitioned tables
Previous Message Amit Kapila 2026-01-12 02:21:33 Re: Proposal: Conflict log history table for Logical Replication