Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ALTER FUNCTION #25042

Open
homar opened this issue Feb 17, 2025 · 2 comments
Open

Add ALTER FUNCTION #25042

homar opened this issue Feb 17, 2025 · 2 comments

Comments

@homar
Copy link
Member

homar commented Feb 17, 2025

Trino already supports ALTER SCHEMA and ALTER TABLE, however ALTER FUNCTION is missing.

It should be possible to modify function's body and/or returned type and set function owner.

Proposed syntax for body/return value modification:

ALTER FUNCTION catalog.schema.function_name
[RETURNS BIGINT]
[BODY]

For setting authorization:

ALTER FUNCTION function_name SET AUTHORIZATION ( user | USER user | ROLE role )
@homar
Copy link
Member Author

homar commented Feb 17, 2025

Subissue for SET AUTHORIZATION part: #25021

@electrum
Copy link
Member

electrum commented Feb 18, 2025

We already support changing the function definition with CREATE OR REPLACE FUNCTION, which is the same as how you replace a view definition. However, as with views, supporting ALTER ... SET AUTHORIZATION makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants