Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands

Jim Jones <jim.jones@uni-muenster.de>

From: Jim Jones <jim.jones@uni-muenster.de>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-26T10:23:40Z
Lists: pgsql-hackers

On 26/02/2026 04:32, Fujii Masao wrote:
> I'm not sure why this behavior isn't documented, but it seems worth
> addressing in a separate documentation patch.

Yeah, it also surprised me a bit. Having a NULL instead of '' in \d* is
IMO not that dramatic, but things get different when accessing the
catalog directly, e.g.

postgres=# \pset null '(null)'
postgres=# CREATE TABLE t (id int);
CREATE TABLE
postgres=# COMMENT ON TABLE t IS '';
COMMENT
postgres=# SELECT obj_description('t'::regclass, 'pg_class');
 obj_description
-----------------
 (null)
(1 row)

Best, Jim



Commits

  1. psql: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands.