192 lines
5.9 KiB
Text
192 lines
5.9 KiB
Text
================================================================================
|
|
body block
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS void AS $$ BEGIN END $$ LANGUAGE sql;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(block
|
|
(dollar_quote)
|
|
(body)
|
|
(dollar_quote))
|
|
(identifier)))
|
|
|
|
================================================================================
|
|
or replace
|
|
================================================================================
|
|
CREATE OR REPLACE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(or_replace)
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)))
|
|
|
|
================================================================================
|
|
immutable
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql IMMUTABLE;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)
|
|
(function_volatility)))
|
|
|
|
================================================================================
|
|
stable
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql STABLE;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)
|
|
(function_volatility)))
|
|
|
|
================================================================================
|
|
volatile
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql VOLATILE;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)
|
|
(function_volatility)))
|
|
|
|
================================================================================
|
|
returns array
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS text[] AS 'select' LANGUAGE sql;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)))
|
|
|
|
================================================================================
|
|
returns setof
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS SETOF text AS 'select' LANGUAGE sql;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(return_setof
|
|
(identifier)))
|
|
(string)
|
|
(identifier)))
|
|
|
|
================================================================================
|
|
returns setof array
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS SETOF text[] AS 'select' LANGUAGE sql;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(return_setof
|
|
(identifier)))
|
|
(string)
|
|
(identifier)))
|
|
|
|
================================================================================
|
|
returns table
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS TABLE(a text, b bigint) AS 'select' LANGUAGE sql;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(return_table
|
|
(var_declaration
|
|
(identifier)
|
|
(identifier))
|
|
(var_declaration
|
|
(identifier)
|
|
(identifier))))
|
|
(string)
|
|
(identifier)))
|
|
|
|
================================================================================
|
|
security definer
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql SECURITY definer;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)
|
|
(function_run_as)))
|
|
|
|
================================================================================
|
|
security invoker
|
|
================================================================================
|
|
CREATE FUNCTION FOO () RETURNS void AS 'select' LANGUAGE sql SECURITY INVOKER;
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(create_function_statement
|
|
(function_signature
|
|
(identifier)
|
|
(function_parameters))
|
|
(function_return
|
|
(identifier))
|
|
(string)
|
|
(identifier)
|
|
(function_run_as)))
|