Skip to content

Commit 9da639a

Browse files
committed
Allow for list of values in ALTER ROLE .. SET
Fixes #106
1 parent 0e7bda0 commit 9da639a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/parser.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4566,7 +4566,7 @@ alter_action_with_role_options
45664566
}
45674567

45684568
alter_action_set_postgresql_option
4569-
= kw:(SET __) name:(ident __) operator:("=" / TO) value:(__ (expr / keyword)) {
4569+
= kw:(SET __) name:(ident __) operator:("=" / TO) value:(__ (list$expr / keyword)) {
45704570
return loc({
45714571
type: "alter_action_set_postgresql_option",
45724572
setKw: read(kw),

test/ddl/role.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ describe("role", () => {
9696
testWc(`ALTER ROLE ALL IN DATABASE foo SET something TO 128`);
9797
});
9898

99+
it(`supports SET parameter TO list,of,values`, () => {
100+
testWc(`ALTER ROLE my_role SET something TO 1, 2, 3`);
101+
testWc(`ALTER ROLE my_role SET foo = 'a', 'b'`);
102+
});
103+
99104
it(`supports SET parameter FROM CURRENT`, () => {
100105
testWc(`ALTER ROLE my_role SET something FROM CURRENT`);
101106
testWc(`ALTER ROLE my_role IN DATABASE foo SET something FROM CURRENT`);

0 commit comments

Comments
 (0)