fmguerreiro opened a new pull request, #2217: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2217
PostgreSQL functions can return sets via `RETURNS SETOF <type>`. This is currently not supported by the parser, which fails when encountering `SETOF` after `RETURNS`. ### Changes - Add `SETOF` keyword - Add `DataType::SetOf(Box<DataType>)` variant - Handle `SETOF` in `parse_postgres_create_function()` - Add test covering simple, schema-qualified, and round-trip cases ### Example ```sql CREATE FUNCTION get_users() RETURNS SETOF TEXT LANGUAGE sql AS 'SELECT name FROM users'; CREATE FUNCTION get_all() RETURNS SETOF my_schema."MyType" LANGUAGE sql AS 'SELECT * FROM t'; ``` ### Reference - [PostgreSQL CREATE FUNCTION docs](https://www.postgresql.org/docs/current/sql-createfunction.html) -- 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]
