Repository navigation
Add ALTER FUNCTION and COMMENT ON FUNCTION - #437
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
ALTER FUNCTION,ALTER ROUTINEandCOMMENT ON FUNCTIONfor the functions in SQL of the catalog.Changes
ALTER FUNCTIONchanges the optionsIMMUTABLE,STABLE,VOLATILE,STRICT,CALLED ON NULL INPUT,PARALLEL,COSTandROWS, asAlterFunctiondoes. A second option of the same kind gives42601at the place of the option.COSTandROWSmust be positive, andROWSneeds a function that returns a set.ALTER FUNCTION ... RENAME TOgives the function a new name. A schema that has a function with the new name and the same argument types gives42723, asIsThereFunctionInNamespacedoes. The views that call the function get a new text.ALTER FUNCTION ... SET SCHEMAmoves the function and itspg_dependentry to the new schema. A move to the schema that has the function already does nothing.ALTER FUNCTION ... OWNER TOchangesproowner, with the checks ofAlterObjectOwner_internalfor a user that is not a superuser.COMMENT ON FUNCTIONsets and clears the comment of a function.DROP FUNCTION, so the errors for a name that is not unique and for a function that does not exist are the same as in PostgreSQL.ALTER FUNCTIONandALTER ROUTINE.Catalog::alter_function.Known differences
procostandprorowsas whole numbers. A value with a fraction gives0A000.SECURITY DEFINER,LEAKPROOF,SUPPORT,SETandRESETgive0A000.0A000.0A000.ALTER PROCEDUREgives0A000, because rupg has no procedures yet.Tests
alter_function. Its expected output is the output of PostgreSQL 19 for the same script.