Re: Long reloption values are truncated by pg_dump and pg_get_indexdef()

From: surya poondla <suryapoondla4(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Subject: Re: Long reloption values are truncated by pg_dump and pg_get_indexdef()
Date: 2026-11-24 20:02:11
Message-ID: CAOVWO5rjgSvbECWC-V+RouNhx3RyCGHreVXfBMO40Th_t3oHbQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Zsolt,

Thank you for the patch.

I applied v1 on master and tested it with dummy_index_am, using values of
63, 64 and 200 bytes:
1. On master, the 64- and 200-byte values are printed unquoted by
pg_get_indexdef(), and both replaying its output and a pg_dump/restore
round trip leave 63-byte values. With v1 they are quoted and the
round-tripped values match the originals. The 63-byte value is still
printed bare, as expected.
2. The new regression test fails on master and passes with the patch.

One observation that may matter for back-patching is pg_dump takes
plain CREATE INDEX statements from the server's pg_get_indexdef(), so
the fe_utils change doesn't help there. Running a patched pg_dump
against an unpatched server still produces a truncating dump. Fixing
this for existing releases therefore needs the ruleutils.c change
back-patched; a newer pg_dump alone is not enough.

Overall the patch looks good to me.

Regards,
Surya Poondla

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-11-24 20:10:12 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Greg Burd 2026-11-24 18:44:15 Re: Hash index: stop registering pin-only bucket pages in WAL (remove REGBUF_NO_CHANGE)