| From: | SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com> |
|---|---|
| To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> |
| Subject: | Re: [PATCH] Resolve unknown-type literals in GRAPH_TABLE COLUMNS |
| Date: | 2026-04-27 06:04:32 |
| Message-ID: | CAHg+QDdzUMW4qQmywiPmVo2z3+HccFZL+mujdXbB+ghU21u7dA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Sun, Apr 26, 2026 at 8:10 AM Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> Hi SATYANARAYANA,
>
> On Sun, Apr 26, 2026 at 3:53 AM SATYANARAYANA NARLAPURAM
> <satyanarlapuram(at)gmail(dot)com> wrote:
> >
> > Hi hackers,
> >
> > transformRangeGraphTable() calls transformExpr() and
> > assign_list_collations() for COLUMNS expressions but missed calling
> > resolveTargetListUnknowns(). As a result, literals such as 'val1'
> > in a COLUMNS clause retained type "unknown", causing failures with
> > ORDER BY, UNION, and output conversions.
> >
> > Fix by calling resolveTargetListUnknowns() on the columns target
> > list right after assign_list_collations(), similar to SELECT target
> lists in
> > transformSelectStmt().
> >
> > Attached a patch to fix this, which also includes test cases to
> reproduce.
>
> I can reproduce this and the patch fixes it.
>
> One question: why is resolveTargetListUnknowns called after
> assign_list_collations?
>
> I'm asking because in transformSelectStmt, resolveTargetListUnknowns
> is invoked before assign_query_collations. It might not matter, but keeping
> the order consistent would be good for readers.
Updated the patch. It should be before.
Thanks,
Satya
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-Resolve-unknown-type-literals-in-GRAPH_TABLE-COLUMNS.patch | application/octet-stream | 4.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dilip Kumar | 2026-04-27 06:14:55 | Re: Support logical replication of DDLs, take2 |
| Previous Message | Michael Paquier | 2026-04-27 05:59:54 | Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks |