[HACKERS] AlterUserStmt anmd RoleSpec rules in grammar.y - Mailing list pgsql-hackers

From Pavel Golub
Subject [HACKERS] AlterUserStmt anmd RoleSpec rules in grammar.y
Date
Msg-id 891404403.20170726171302@gf.microolap.com
Whole thread Raw
Responses Re: [HACKERS] AlterUserStmt anmd RoleSpec rules in grammar.y
List pgsql-hackers
Hello, hackers.

I need someone to throw some light on grammar (gram.y).
I'm investigating beta2 regression tests, and found new statement

`ALTER USER ALL SET application_name to 'SLAP';`           ^^^

I know for sure that in beta1 this operator fails. So I decided to recheck gram.y:

AlterUserStmt:           ALTER USER RoleSpec SetResetClause;
....
RoleSpec:    NonReservedWord            | CURRENT_USER            | SESSION_USER;

But *ALL is reserved word*! Thus "ALTER ROLE\USER ALL" should fail.

OK, I checked in Pg10 beta2, installer provided by EDB. It worked.

Then I asked someone to check this against fresh built server from
'master'. It failed.

So, the situation is:

1. Docs say this is correct statement:
https://www.postgresql.org/docs/devel/static/sql-alterrole.html

2. The sources in master don't support such production:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/gram.y;h=4b1ce09c445a5ee249a965ec0953b122df71eb6f;hb=refs/heads/master
Line 1179 for AlterUserSetStmt rule;
Line 14515 for RoleSpec rule;

3. EDB 10beta2 server supports it.

What's going on?



-- 
With best wishes,Pavel                          mailto:pavel@gf.microolap.com




pgsql-hackers by date:

Previous
From: Jordan Gigov
Date:
Subject: Re: [HACKERS] Change in "policy" on dump ordering?
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] [PATCH v3] pg_progress() SQL function to monitorprogression of long running SQL queries/utilities