[PATCH] Fix escaping for '\' and '"' in pageinspect for gist

From: Roman Khapov <rkhapov(at)yandex-team(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: michael(at)paquier(dot)xyz
Subject: [PATCH] Fix escaping for '\' and '"' in pageinspect for gist
Date: 2025-12-29 15:47:58
Message-ID: 96E68E0F-FE4C-4114-92C9-689AC6DF7634@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers!

I noticed, that there is bug in escaping values that contains '\' or '"' in text representation
inside pageinspect for gist: the string 'foo"bar' are printed like "foo""bar" and not "foo\"bar".

To fix that, we should do appendStringInfoCharMacro(&buf, '\\'); instead of
appendStringInfoCharMacro(&buf, ch); in case ch is one of that symbols.

Any thoughts?

--
Best regards,
Roman Khapov

Attachment Content-Type Size
v1-0001-fix-escaping-in-pageinspect-for-gist.patch application/octet-stream 863 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-12-29 15:52:58 Re: Define DatumGetInt8 function.
Previous Message Roman Khapov 2025-12-29 15:13:05 Re: TAB completion for ALTER TABLE ... ALTER CONSTRAINT ... ENFORCED