mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
SQL procedures
This adds a new object type "procedure" that is similar to a function but does not have a return type and is invoked by the new CALL statement instead of SELECT or similar. This implementation is aligned with the SQL standard and compatible with or similar to other SQL implementations. This commit adds new commands CALL, CREATE/ALTER/DROP PROCEDURE, as well as ALTER/DROP ROUTINE that can refer to either a function or a procedure (or an aggregate function, as an extension to SQL). There is also support for procedures in various utility commands such as COMMENT and GRANT, as well as support in pg_dump and psql. Support for defining procedures is available in all the languages supplied by the core distribution. While this commit is mainly syntax sugar around existing functionality, future features will rely on having procedures as a separate object type. Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
This commit is contained in:
@ -378,6 +378,8 @@ ExecRenameStmt(RenameStmt *stmt)
|
||||
case OBJECT_OPCLASS:
|
||||
case OBJECT_OPFAMILY:
|
||||
case OBJECT_LANGUAGE:
|
||||
case OBJECT_PROCEDURE:
|
||||
case OBJECT_ROUTINE:
|
||||
case OBJECT_STATISTIC_EXT:
|
||||
case OBJECT_TSCONFIGURATION:
|
||||
case OBJECT_TSDICTIONARY:
|
||||
@ -495,6 +497,8 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt,
|
||||
case OBJECT_OPERATOR:
|
||||
case OBJECT_OPCLASS:
|
||||
case OBJECT_OPFAMILY:
|
||||
case OBJECT_PROCEDURE:
|
||||
case OBJECT_ROUTINE:
|
||||
case OBJECT_STATISTIC_EXT:
|
||||
case OBJECT_TSCONFIGURATION:
|
||||
case OBJECT_TSDICTIONARY:
|
||||
@ -842,6 +846,8 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
|
||||
case OBJECT_OPERATOR:
|
||||
case OBJECT_OPCLASS:
|
||||
case OBJECT_OPFAMILY:
|
||||
case OBJECT_PROCEDURE:
|
||||
case OBJECT_ROUTINE:
|
||||
case OBJECT_STATISTIC_EXT:
|
||||
case OBJECT_TABLESPACE:
|
||||
case OBJECT_TSDICTIONARY:
|
||||
|
Reference in New Issue
Block a user