vscode-cosmosdb
vscode-cosmosdb copied to clipboard
Succeed to execute a query when executing the query with the function name "test," in the opened .psql file
OS: Win10 Build Version: 20210323.1
Repro Steps:
- Expand a PostgreSQL server -> Postgres -> Right click "functions" node -> Click "Create Function Query..." -> Type function name with "test," -> There is a verification prompt.
- Type a valid function name, e.g. "test" -> Select a return type -> Change the function name to "test," in the opened file -> Click "Execute Query".
- Check whether the query is executed successfully.
Expect: Fail to execute query.
Actual:
Succeed to execute query.
I can still run queries against a function with a comma in the name as long as it is wrapped in quotes.
We can possibly remove the "," restriction on the extension creating functions.
Verified on the latest build 20210610.3, this issue also reproduces for other function names.
- [ ] Update Postgres Function name validation for next release.
This issue also reproduce for stored procedures.
Create the stored procedure with the name "test*01" successfully after changing the name in the opened .psql
file.
I don't know where the validation rule come from but I think it's a recommendation rather than requirement. According to this, people can name things using those characters but it would require more careful handling of them. https://www.postgresql.org/docs/7.0/syntax525.htm#:~:text=Names%20in%20SQL%20must%20begin,but%20they%20will%20be%20truncated.
I'll defer relaxing the validation rules until someone complains.