@@ -178,8 +178,6 @@ export const postgresqlKeywords: Record<string, boolean> = {
178178 . filter ( ( [ _ , def ] ) => def . reserved )
179179 . map ( ( [ kw ] ) => [ kw , true ] )
180180 ) ,
181- // TODO: Temporarily including these actually non-reserved words
182- SET : true ,
183181} ;
184182
185183export const postgresqlRequiresAsKeywords : Record < string , boolean > = {
@@ -188,6 +186,19 @@ export const postgresqlRequiresAsKeywords: Record<string, boolean> = {
188186 . filter ( ( [ _ , def ] ) => def . requiresAs || def . reserved )
189187 . map ( ( [ kw ] ) => [ kw , true ] )
190188 ) ,
191- // TODO: Temporarily including these actually non-reserved words
189+
190+ // TODO: SET is non-reserved keyword in PostgreSQL
191+ // and it's also allowed as implicit alias,
192+ // but that causes a "conflict" in UPDATE ... SET statement.
193+ //
194+ // The following is allowed:
195+ // UPDATE foo SET set = 10;
196+ //
197+ // But the following is error:
198+ // UPDATE foo set SET x = 10;
199+ //
200+ // PostgreSQL parser pulls some magic to deal with this.
201+ // As only crazy people really need this, and most other dialects treat SET
202+ // as reserved keyword, we'll require AS for SET as a workaround for now.
192203 SET : true ,
193204} ;
0 commit comments