Re: set_config(‘search_path’) does not truncate names over 63 bytes, unlike SET

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Manav Kumar <mkumar(at)yugabyte(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: set_config(‘search_path’) does not truncate names over 63 bytes, unlike SET
Date: 2026-11-04 14:47:20
Message-ID: CAGRkXqRj24qYzVwcPLxm430b2=87UB57vXCXr2yCJWmKh+3zdg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Daniel,

That is a good point!

It does not need 10MB. Anything over 30000
bytes does it. libpq only accepts messages that long for a few types,
and ParameterStatus is not one of them. search_path became
GUC_REPORT in 18, so the following patch needs backport to 18.

It is worse with ALTER ROLE. A role with a search_path that long can't
login anymore. But likely nobody is doing that.

ALTER ROLE r SET search_path = '<30100 bytes>';

$ psql -U r
psql: error: ... lost synchronization with server

The attached 001 adds ParameterStatus to VALID_LONG_MESSAGE_TYPE
002 is optional test.

Thanks,
Shihao

Attachment Content-Type Size
v1-0002-Add-a-test-for-long-ParameterStatus-messages.patch application/octet-stream 1.9 KB
v1-0001-libpq-Accept-long-ParameterStatus-messages.patch application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2026-11-04 15:27:17 Re: set_config(‘search_path’) does not truncate names over 63 bytes, unlike SET
Previous Message shihao zhong 2026-11-04 14:33:55 Re: BUG #19775: Incremental backup without data checksums restores a stale visibility map page after VACUUM truncati