CREATEUSER == SUPERUSER?

Started by Yoshiyuki Asabaover 20 years ago2 messagespatches
Jump to latest
#1Yoshiyuki Asaba
y-asaba@sraoss.co.jp

Hi,

The following command makes a superuser. Is this correct?

template1=# CREATE USER xyz CREATEUSER;
CREATE ROLE
template1=# select rolname,rolsuper from pg_roles where rolname = 'xyz';
rolname | rolsuper
---------+----------
xyz | t
(1 row)

I think CREATEUSER keyword is equal to CREATEROLE.

Regards,
--
Yoshiyuki Asaba
y-asaba@sraoss.co.jp

Attachments:

gram.y.patchtext/plain; charset=us-asciiDownload+6-6
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Yoshiyuki Asaba (#1)
Re: CREATEUSER == SUPERUSER?

Yoshiyuki Asaba <y-asaba@sraoss.co.jp> writes:

The following command makes a superuser. Is this correct?

template1=# CREATE USER xyz CREATEUSER;

Yes, read the CREATE ROLE documentation:

CREATEUSER
NOCREATEUSER

These clauses are an obsolete, but still accepted, spelling of
SUPERUSER and NOSUPERUSER. Note that they are not equivalent to
CREATEROLE as one might naively expect!

I think CREATEUSER keyword is equal to CREATEROLE.

The proposed patch breaks backward compatibility, which is the only
reason we still allow these keywords at all.

regards, tom lane