Re: oddity with ALTER ROLE/USER

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: oddity with ALTER ROLE/USER
Date: 2019-02-22 22:22:09
Message-ID: 5b7a332b-5d38-5910-84c8-45804ee4e5db@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/22/19 4:19 PM, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>> I noticed that ALTER ROLE/USER succeeds even when called without any
>> options:
>
>> postgres=# alter user foo;
>> ALTER ROLE
>> postgres=# alter role foo;
>> ALTER ROLE
>> postgres=# alter group foo;
>> ERROR: syntax error at or near ";"
>> LINE 1: alter group foo;
>
>> That seems odd, does nothing useful, and is inconsistent with, for
>> example, ALTER GROUP as shown above.
>
>> Proposed patch attached.
>
> If you want to make it act like alter group, why not make it act
> like alter group? That is, the way to fix this is to change the
> grammar so that AlterOptRoleList doesn't permit an expansion with
> zero list elements.

I considered that but liked the more specific error message.

> Having said that, I can't get excited about changing this at all.
> Nobody will thank us for it, and someone might complain.

The other route is change the documentation to reflect reality I guess.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-02-22 22:42:49 Re: Refactoring the checkpointer's fsync request queue
Previous Message Andres Freund 2019-02-22 22:15:47 Re: Refactoring the checkpointer's fsync request queue