Cannot use schema "public" cause it is considered as a keyword
Version
latest
Which SQL?
Postgre
SQL content
select * from public.|
JavaScript/TypeScript code
It can be reproduced online: https://dtstack.github.io/monaco-sql-languages/
What happened?
在 PostgreSQL 中默认情况下,当创建一个新数据库时,会自动创建一个名为 "public" 的模式。所有没有指定模式的对象(如表、视图、函数等)默认都会被创建在 "public" 模式中。 虽然说在PostgresSQL中RoleSpec的语法里确实有PUBLIC的关键字,但是由于它是一个默认的模式名称,很多时候用户在使用时不可避免地要使用到这个schema,现在我看到似乎是因为在ANTLR4的定义文件里将public定义为了关键字,直接使用时会提示错误。语法解析也会中止在这个位置。不知道是否有办法处理一下?
In PostgreSQL, by default, when a new database is created, a schema named "public" is automatically created. All objects (such as tables, views, functions, etc.) that do not have a specified schema are created in the "public" schema by default.
Although the PUBLIC keyword does exist in the RoleSpec syntax in PostgreSQL, it is also a default schema name that users often need to use. Now, I see that because "public" is defined as a keyword in the ANTLR4 definition file, using it directly results in an error. The parser will also stop at this position. Is there any way to handle this?
Relevant log output
No response