Open mpyw opened 2 months ago
PostgreSQL: Documentation: 16: CREATE FUNCTION
CREATE [ OR REPLACE ] FUNCTION
name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | = } default_expr ] [, ...] ] )
[ RETURNS rettype
| RETURNS TABLE ( column_name column_type [, ...] ) ]
{ LANGUAGE lang_name
| TRANSFORM { FOR TYPE type_name } [, ... ]
| WINDOW
| { IMMUTABLE | STABLE | VOLATILE }
| [ NOT ] LEAKPROOF
| { CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT }
| { [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER }
| PARALLEL { UNSAFE | RESTRICTED | SAFE }
| COST execution_cost
| ROWS result_rows
| SUPPORT support_function
| SET configuration_parameter { TO value | = value | FROM CURRENT }
| AS 'definition'
| AS 'obj_file', 'link_symbol'
| sql_body
} ...
Here -> | SET configuration_parameter { TO value | = value | FROM CURRENT }
Note: It is important to mention that FROM CURRENT
does not always refer to the actual current session state. Unfortunately, it refers to the state at the time the CREATE FUNCTION
command is executed. Despite this limitation, using the syntax like SET lock_timeout TO '0'
is still very meaningful, and therefore, I strongly request that this syntax be supported at a minimum.
Description:
I would like to request a new feature in Atlas HCL to support the following SQL syntax within function definitions:
In this example, the function temporarily sets the advisory lock timeout and restores the previous value upon exit. The syntax
SET ... FROM CURRENT
is used to revert the session's configuration back to its original state, making it essential for scenarios where temporary session configurations are needed.However, the current version of Atlas HCL does not seem to support the
SET ... FROM CURRENT
syntax within function definitions, which is not limited tolock_timeout
but applies to any session configuration.Adding support for this syntax in function definitions would significantly enhance Atlas's ability to manage and manipulate temporary session settings efficiently.
Thank you for considering this request.