microsoft / vscode-cosmosdb

Azure Databases extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-cosmosdb
MIT License
155 stars 68 forks source link

Fail to execute the stored procedure query named with the existing function name #2232

Closed v-ruizh closed 6 months ago

v-ruizh commented 8 months ago

OS: Win10 Build Version: 20240112.17

Repro Steps:

  1. Create a PostgreSQL Flexible server.
  2. Expand the PostgreSQL Flexible server -> postgre database -> Create a function "one" for this database.
  3. Create a stored procedure query with name "one" -> Execute this query.
  4. Check whether succeeds to execute the stored procedure query named with the existing function name or not.

Expect: Succeeds to execute the stored procedure query named with the existing function name.

Actual: Fail to execute the stored procedure query named with the existing function name. image

More Info:

  1. This issue also reproduces for PostgreSQL Single server.
  2. This issue also reproduces when executing the function query named with the existing stored procedure name.
JasonYeMSFT commented 6 months ago

Debugging the code reveals more details:

image

In PostgreSQL, both functions and procedures are different kinds of routines. If a function with the same name exists, the error message indicates that the new procedure cannot be created because by doing so, it would effectively change the "kind" of the existing function to "procedure". The error is expected.