| From: | Richard Guo <guofenglinux(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, John Naylor <johncnaylorls(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Fix missing FORMAT when deparsing JSON_ARRAY(query) |
| Date: | 2026-07-24 00:45:46 |
| Message-ID: | CAMbWs494Fv8KN7EU-rc50dFffj1Pr6EsH=dNkJJuoaQB5e-_wA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Jul 23, 2026 at 11:59 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Actually, since I'm sitting here at the AI workshop, I thought I'd
> try using Claude Code to generate a patch. Here's what it came up
> with, after only light steering by me (I told it to factor the patch
> this way, rather than making independent v19 and v20 patches).
> I would have used a much shorter test case, and some of the comments
> seem overly verbose too, but otherwise not bad.
I just took a brief look at this bug and concluded that the root cause
is that ForPortionOfExpr carries the range column in two redundant
forms: rangeVar and range_name. At deparse time, ruleutils.c prints
the range_name, which can be stale after RENAME.
And the patch Claude came up with here makes sense to me. The
rangeVar field already holds everything we need to print the
up-to-date name, so removing the range_name field makes sense.
A nit:
I'm not sure about this change in 0002:
tle = makeTargetEntry((Expr *) rangeTLEExpr, range_attno,
- forPortionOf->range_name, false);
+ pstrdup(NameStr(attr->attname)), false);
forPortionOf is a ForPortionOfClause, and range_name is a valid field.
> It was Claude's idea to have 2 patches at all: it thought we should
> avoid a post-beta2 catversion bump in v19. I might agree with it
> except I see catversion was bumped just a few days ago in v19,
> so there's no benefit in not doing so again.
Yeah, since catversion was already bumped post-beta2 in commit
372b8d1ad, I see no reason why we can't bump it again here.
- Richard
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ian Lawrence Barwick | 2026-07-24 01:29:58 | Re: [PATCH] Rename "getdatabaseencoding()" to "pg_database_encoding()", and document |
| Previous Message | Jehan-Guillaume de Rorthais | 2026-07-23 22:18:59 | Re: Possible Visibility Map corruption in supported branches? |