Re: Fix incorrect column name in error message for range partition bound check
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: myzhen <zhenmingyang@yeah.net>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-01-12T02:45:42Z
Lists: 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
Commits
-
Fix possible incorrect column reference in ERROR message
- a65995947cfe 14.21 landed
- 3ad05640b67f 15.16 landed
- 821c4d27bca2 16.12 landed
- 84b787ae66e6 17.8 landed
- c35e5dd9ae97 18.2 landed
- 349107537d22 19 (unreleased) landed