Hi,

When I review [1], I found commit 8e78f0a1 deprecated the IN GROUP and USER
clauses in CREATE ROLE, and also removed IN GROUP and USER from the psql \h
CREATE ROLE help output.

However, the psql help for the legacy synonyms CREATE USER and CREATE GROUP
still lists the deprecated options:

- IN GROUP role_name [, ...]
- USER role_name [, ...]

postgres=# \h create role
Command:     CREATE ROLE
Description: define a new database role
Syntax:
CREATE ROLE name [ [ WITH ] option [ ... ] ]

where option can be:

      SUPERUSER | NOSUPERUSER
    | CREATEDB | NOCREATEDB
    | CREATEROLE | NOCREATEROLE
    | INHERIT | NOINHERIT
    | LOGIN | NOLOGIN
    | REPLICATION | NOREPLICATION
    | BYPASSRLS | NOBYPASSRLS
    | CONNECTION LIMIT connlimit
    | [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
    | VALID UNTIL 'timestamp'
    | IN ROLE role_name [, ...]
    | ROLE role_name [, ...]
    | ADMIN role_name [, ...]
    | SYSID uid

URL: https://www.postgresql.org/docs/devel/sql-createrole.html

postgres=# \h create user
Command:     CREATE USER
Description: define a new database role
Syntax:
CREATE USER name [ [ WITH ] option [ ... ] ]

where option can be:

      SUPERUSER | NOSUPERUSER
    | CREATEDB | NOCREATEDB
    | CREATEROLE | NOCREATEROLE
    | INHERIT | NOINHERIT
    | LOGIN | NOLOGIN
    | REPLICATION | NOREPLICATION
    | BYPASSRLS | NOBYPASSRLS
    | CONNECTION LIMIT connlimit
    | [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
    | VALID UNTIL 'timestamp'
    | IN ROLE role_name [, ...]
    | IN GROUP role_name [, ...]
    | ROLE role_name [, ...]
    | ADMIN role_name [, ...]
    | USER role_name [, ...]
    | SYSID uid

URL: https://www.postgresql.org/docs/devel/sql-createuser.html

postgres=# \h create group
Command:     CREATE GROUP
Description: define a new database role
Syntax:
CREATE GROUP name [ [ WITH ] option [ ... ] ]

where option can be:

      SUPERUSER | NOSUPERUSER
    | CREATEDB | NOCREATEDB
    | CREATEROLE | NOCREATEROLE
    | INHERIT | NOINHERIT
    | LOGIN | NOLOGIN
    | REPLICATION | NOREPLICATION
    | BYPASSRLS | NOBYPASSRLS
    | CONNECTION LIMIT connlimit
    | [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
    | VALID UNTIL 'timestamp'
    | IN ROLE role_name [, ...]
    | IN GROUP role_name [, ...]
    | ROLE role_name [, ...]
    | ADMIN role_name [, ...]
    | USER role_name [, ...]
    | SYSID uid

URL: https://www.postgresql.org/docs/devel/sql-creategroup.html

Since CREATE USER is documented as equivalent to CREATE ROLE WITH LOGIN, and
CREATE GROUP is equivalent to CREATE ROLE, their help syntax should remain
consistent with CREATE ROLE.

I propose removing the deprecated IN GROUP and USER lines from the help text
of both CREATE USER and CREATE GROUP. This would be a simple documentation
cleanup that aligns the psql help with current reality and avoids confusing
users with obsolete syntax.

[1] 
https://www.postgresql.org/message-id/4c5f895e-3281-48f8-b943-9228b7da6471%40gmail.com

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.

>From d8145f1c08123a8bd80b571e99343648cc02de65 Mon Sep 17 00:00:00 2001
From: Japin Li <[email protected]>
Date: Tue, 6 Jan 2026 18:03:13 +0800
Subject: [PATCH v1] Remove deprecated role options for CREATE USER/GROUP

Commit 8e78f0a1 deprecated the IN GROUP and USER clauses in CREATE ROLE
and removed them from the psql \h CREATE ROLE output.

However, the legacy synonyms CREATE USER and CREATE GROUP continued to list
these deprecated options in their \h help text:

    | IN GROUP role_name [, ...]
    | USER role_name [, ...]

Since CREATE USER is equivalent to CREATE ROLE ... WITH LOGIN and
CREATE GROUP is equivalent to CREATE ROLE, their help syntax should stay
consistent with CREATE ROLE to avoid confusing users with obsolete syntax.

This commit removes the deprecated IN GROUP and USER lines from the psql
help output for CREATE USER and CREATE GROUP.
---
 doc/src/sgml/ref/create_group.sgml | 2 --
 doc/src/sgml/ref/create_user.sgml  | 2 --
 2 files changed, 4 deletions(-)

diff --git a/doc/src/sgml/ref/create_group.sgml b/doc/src/sgml/ref/create_group.sgml
index d124c98eb51..119d5ff3eb4 100644
--- a/doc/src/sgml/ref/create_group.sgml
+++ b/doc/src/sgml/ref/create_group.sgml
@@ -36,10 +36,8 @@ CREATE GROUP <replaceable class="parameter">name</replaceable> [ [ WITH ] <repla
     | [ ENCRYPTED ] PASSWORD '<replaceable class="parameter">password</replaceable>' | PASSWORD NULL
     | VALID UNTIL '<replaceable class="parameter">timestamp</replaceable>'
     | IN ROLE <replaceable class="parameter">role_name</replaceable> [, ...]
-    | IN GROUP <replaceable class="parameter">role_name</replaceable> [, ...]
     | ROLE <replaceable class="parameter">role_name</replaceable> [, ...]
     | ADMIN <replaceable class="parameter">role_name</replaceable> [, ...]
-    | USER <replaceable class="parameter">role_name</replaceable> [, ...]
     | SYSID <replaceable class="parameter">uid</replaceable>
 </synopsis>
  </refsynopsisdiv>
diff --git a/doc/src/sgml/ref/create_user.sgml b/doc/src/sgml/ref/create_user.sgml
index 48d2089238c..8a138c001c2 100644
--- a/doc/src/sgml/ref/create_user.sgml
+++ b/doc/src/sgml/ref/create_user.sgml
@@ -36,10 +36,8 @@ CREATE USER <replaceable class="parameter">name</replaceable> [ [ WITH ] <replac
     | [ ENCRYPTED ] PASSWORD '<replaceable class="parameter">password</replaceable>' | PASSWORD NULL
     | VALID UNTIL '<replaceable class="parameter">timestamp</replaceable>'
     | IN ROLE <replaceable class="parameter">role_name</replaceable> [, ...]
-    | IN GROUP <replaceable class="parameter">role_name</replaceable> [, ...]
     | ROLE <replaceable class="parameter">role_name</replaceable> [, ...]
     | ADMIN <replaceable class="parameter">role_name</replaceable> [, ...]
-    | USER <replaceable class="parameter">role_name</replaceable> [, ...]
     | SYSID <replaceable class="parameter">uid</replaceable>
 </synopsis>
  </refsynopsisdiv>
-- 
2.43.0

Reply via email to