MrBisonte opened a new pull request, #2841:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2841

   Dialects: PostgreSQL, Generic
   
   `CREATE PROCEDURE insert_data(a integer, b integer) LANGUAGE SQL AS $$ 
INSERT INTO tbl VALUES (a); INSERT INTO tbl VALUES (b); $$`, the first example 
of https://www.postgresql.org/docs/current/sql-createprocedure.html, failed 
with `Expected: an SQL statement, found: $$ ...`. `parse_create_procedure` read 
everything after `AS` as statements, the MSSQL form, so a single quoted body, 
`AS 'definition'`, failed the same way.
   
   A string after `AS` now becomes `CreateProcedureBody::AsString { body, 
link_symbol }`, read by the code that already reads a `CREATE FUNCTION` string 
body, moved into `parse_definition_string`. `LANGUAGE` may also follow the 
string, and prints before `AS`, as it does for `CREATE FUNCTION`. Any other 
token after `AS` keeps the statement path.
   
   `CREATE OR REPLACE PROCEDURE` is still rejected, and will follow in its own 
PR.
   
   Written with an AI coding assistant.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to