Re: Error position support for ComputeIndexAttrs
amul sul <sulamul@gmail.com>
From: Amul Sul <sulamul@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-12-16T13:00:23Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add parse location to IndexElem.
- 62299bbd90d6 19 (unreleased) landed
-
Include error location in errors from ComputeIndexAttrs().
- ba75f717526c 19 (unreleased) landed
-
Error position support for partition specifications
- 1e5e4efd02b6 12.0 cited
On Tue, Dec 16, 2025 at 12:51 PM jian he <jian.universality@gmail.com> wrote: > > hi. > > Following the addition of error position support to ComputePartitionAttrs in > [0], we can extend this feature to ComputeIndexAttrs. > > Both partition keys and indexes support expressions and share a 32-column > limit, CREATE INDEX can be as complicated as PARTITION BY expression, and given > that ComputeIndexAttrs already contains 14 calls to ereport(ERROR, ...). > Adding error position support for ComputeIndexAttrs seems to make sense. > > To achieve this, ComputeIndexAttrs must receive a ParseState. Since > ComputeIndexAttrs is nested under DefineIndex , DefineIndex must also have a > ParseState. > > v1-0001: almost the same as [1], the only difference is after > makeNode(IndexElem), > we should set the location to -1. > v1-0002: Error position support for ComputeIndexAttrs > +1, patch looks quite straightforward and pretty much reasonable to me. Regards, Amul