Re: Feature: psql - display current search_path in prompt

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Florents Tselai <florents.tselai@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Jim Jones <jim.jones@uni-muenster.de>, Jelte Fennema-Nio <postgres@jeltef.nl>, Lauri Siltanen <lauri.siltanen@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-10-25T07:57:11Z
Lists: pgsql-hackers

> On Oct 25, 2025, at 12:38, Florents Tselai <florents.tselai@gmail.com> wrote:
>  
>  <v3-0001-psql-Add-S-prompt-escape-to-display-current-searc.patch>

Overall LGTM. Just one comment:

```
+					/* current search_path, or "?" if not reported by the server */
+				case 'S':
+					strlcpy(buf, session_search_path(), sizeof(buf));
+					break;
```

I guess we also need to update the function comment to add a description for “%S”.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







Commits

  1. Add psql PROMPT variable for search_path.

  2. doc PG 18 relnotes: add AFTER trigger user change item