codekingpro/portable-devtools
114k
1���� �sphinx.addnodes��document���)��}�(� rawsource�� ��children�]�(�docutils.nodes��target���)��}�(h�.. _function_dialog:�h]��2attributes�}�(�ids�]��classes�]��names�]��dupnames�]��backrefs�]��refid��function-dialog�u�tagname�h3�line�K�parent�h� _document�h�source��jD:\a\pgadmin-packaging-foundation\pgadmin-packaging-foundation\pgadmin4-8.6\docs\en_US\function_dialog.rst�ubh �section���)��}�(hhh]�(h �title���)��}�(h�`Function Dialog`:index:�h]�(h �index���)��}�(hhh]�h}�(h]�h]�h]�h]�h]��entries�]�(�single��Function Dialog��index-0�hNt�auhh/h"h#hKh h+ubh)��}�(hhh]�h}�(h]�h>ah]�h]�h]�h]�uhh4h h+ubh �Text����Function Dialog�����}�(h h+h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhh)h h&h!hh"h#hKubh � paragraph���)��}�(h��Use the *Function* dialog to define a function. If you drop and then recreate5a function, the new function is not the same entity as the old; you must drop6existing rules, views, triggers, etc. that refer to the old function.�h]�(hJ�Use the �����}�(h hWh!hh"NhNubh �emphasis���)��}�(h�7*Function*�h]�hJ�Function�����}�(h hah!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hWubhJ�� dialog to define a function. If you drop and then recreate8a function, the new function is not the same entity as the old; you must drop9existing rules, views, triggers, etc. that refer to the old function.�����}�(h hWh!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh h&h!hubhV)��}�(h��The *Function* dialog organizes the development of a function through the10following dialog tabs: *General*, *Definition*, *Code*, *Options*,11*Parameters*, and *Security*. The *SQL* tab displays the SQL code generated by12dialog selections.�h]�(hJ�The �����}�(h hyh!hh"NhNubh`)��}�(h�13*Function*�h]�hJ�Function�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�S dialog organizes the development of a function through the14following dialog tabs: �����}�(h hyh!hh"NhNubh`)��}�(h� *General*�h]�hJ�General�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�, �����}�(h hyh!hh"NhNubh`)��}�(h�*Definition*�h]�hJ�15Definition�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�, �����}�h hysbh`)��}�(h�*Code*�h]�hJ�Code�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�, �����}�h hysbh`)��}�(h� *Options*�h]�hJ�Options�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�,16�����}�(h hyh!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�17Parameters�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�, and �����}�(h hyh!hh"NhNubh`)��}�(h�18*Security*�h]�hJ�Security�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�. The �����}�(h hyh!hh"NhNubh`)��}�(h�*SQL*�h]�hJ�SQL�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�: tab displays the SQL code generated by19dialog selections.�����}�(h hyh!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh h&h!hubh �image���)��}�(h�`.. image:: images/function_general.png20 :alt: Function dialog general tab21 :align: center22�h]�h}�(h]�h]�h]�h]�h]��alt��Function dialog general tab��align��center��uri��images/function_general.png��23candidates�}��*�j( suhj h"h#hKh h&h!hubhV)��}�(h�;Use the fields in the *General* tab to identify a function:�h]�(hJ�Use the fields in the �����}�(h j, h!hh"NhNubh`)��}�(h� *General*�h]�hJ�General�����}�(h j4 h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j, ubhJ� tab to identify a function:�����}�(h j, h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh h&h!hubh �bullet_list���)��}�(hhh]�(h � list_item���)��}�(h�zUse the *Name* field to add a descriptive name for the function. The name will24be displayed in the *pgAdmin* tree control.�h]�hV)��}�(h�zUse the *Name* field to add a descriptive name for the function. The name will25be displayed in the *pgAdmin* tree control.�h]�(hJ�Use the �����}�(h jW h!hh"NhNubh`)��}�(h�*Name*�h]�hJ�Name�����}�(h j_ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jW ubhJ�U field to add a descriptive name for the function. The name will26be displayed in the �����}�(h jW h!hh"NhNubh`)��}�(h� *pgAdmin*�h]�hJ�pgAdmin�����}�(h jq h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jW ubhJ� tree control.�����}�(h jW h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh jS ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKh jN h!hubjR )��}�(h�dUse the drop-down listbox next to *Owner* to select the name of the role that27will own the function.�h]�hV)��}�(h�dUse the drop-down listbox next to *Owner* to select the name of the role that28will own the function.�h]�(hJ�"Use the drop-down listbox next to �����}�(h j� h!hh"NhNubh`)��}�(h�*Owner*�h]�hJ�Owner�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�; to select the name of the role that29will own the function.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKh jN h!hubjR )��}�(h�fUse the drop-down listbox next to *Schema* to select the schema in which the30function will be created.�h]�hV)��}�(h�fUse the drop-down listbox next to *Schema* to select the schema in which the31function will be created.�h]�(hJ�"Use the drop-down listbox next to �����}�(h j� h!hh"NhNubh`)��}�(h�*Schema*�h]�hJ�Schema�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�< to select the schema in which the32function will be created.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKh jN h!hubjR )��}�(h�7Store notes about the function in the *Comment* field.33�h]�hV)��}�(h�6Store notes about the function in the *Comment* field.�h]�(hJ�&Store notes about the function in the �����}�(h j� h!hh"NhNubh`)��}�(h� *Comment*�h]�hJ�Comment�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� field.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKh jN h!hubeh}�(h]�h]�h]�h]�h]��bullet�j+ uhjL h"h#hKh h&h!hubhV)��}�(h�'Click the *Definition* tab to continue.�h]�(hJ�34Click the �����}�(h j h!hh"NhNubh`)��}�(h�*Definition*�h]�hJ�35Definition�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ� tab to continue.�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh h&h!hubj )��}�(h�f.. image:: images/function_definition.png36 :alt: Function dialog definition tab37 :align: center38�h]�h}�(h]�h]�h]�h]�h]��alt��Function dialog definition tab��align��center��uri��images/function_definition.png�j) }�j+ jC suhj h"h#hK h h&h!hubhV)��}�(h�>Use the fields in the *Definition* tab to define the function:�h]�(hJ�Use the fields in the �����}�(h jE h!hh"NhNubh`)��}�(h�*Definition*�h]�hJ�39Definition�����}�(h jM h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jE ubhJ� tab to define the function:�����}�(h jE h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK$h h&h!hubjM )��}�(hhh]�(jR )��}�(h�LMove the *Custom return type?* switch to provide a user defined return type.�h]�hV)��}�(hjj h]�(hJ� Move the �����}�(h jl h!hh"NhNubh`)��}�(h�*Custom return type?*�h]�hJ�Custom return type?�����}�(h js h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�. switch to provide a user defined return type.�����}�(h jl h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK&h jh ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK&h je h!hubjR )��}�(h��Use the drop-down listbox next to *Return type* to select the data type40returned by the function, if any. If *Custom return type?* is enabled this field41will change to an input text field.�h]�hV)��}�(h��Use the drop-down listbox next to *Return type* to select the data type42returned by the function, if any. If *Custom return type?* is enabled this field43will change to an input text field.�h]�(hJ�"Use the drop-down listbox next to �����}�(h j� h!hh"NhNubh`)��}�(h�
*Return type*�h]�hJ�Return type�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�> to select the data type44returned by the function, if any. If �����}�(h j� h!hh"NhNubh`)��}�(h�*Custom return type?*�h]�hJ�Custom return type?�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�: is enabled this field45will change to an input text field.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK'h j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK'h je h!hubjR )��}�(h�iUse the drop-down listbox next to *Language* to select the implementation46language. The default is *sql*.�h]�hV)��}�(h�iUse the drop-down listbox next to *Language* to select the implementation47language. The default is *sql*.�h]�(hJ�"Use the drop-down listbox next to �����}�(h j� h!hh"NhNubh`)��}�(h�48*Language*�h]�hJ�Language�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�7 to select the implementation49language. The default is �����}�(h j� h!hh"NhNubh`)��}�(h�*sql*�h]�hJ�sql�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK*h j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK*h je h!hubjR )��}�(hXZ Use the fields in the *Arguments* to define an argument. Click the *Add*50icon (+) to set parameters and values for the argument:51 52* Use the drop-down listbox in the *Data type* field to select a data type.53* Use the drop-down listbox in the *Mode* field to select a mode. Select *IN*54 for an input parameter; select *OUT* for an output parameter; select *INOUT*55 for both an input and an output parameter; or, select *VARIADIC* to specify a56 VARIADIC parameter.57* Provide a name for the argument in the *Argument Name* field.58* Specify a default value for the argument in the *Default Value* field.59�h]�(hV)��}�(h��Use the fields in the *Arguments* to define an argument. Click the *Add*60icon (+) to set parameters and values for the argument:�h]�(hJ�Use the fields in the �����}�(h j
h!hh"NhNubh`)��}�(h�*Arguments*�h]�hJ� Arguments�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j
ubhJ�" to define an argument. Click the �����}�(h j
h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h j' h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j
ubhJ�861icon (+) to set parameters and values for the argument:�����}�(h j
h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK,h j ubjM )��}�(hhh]�(jR )��}�(h�IUse the drop-down listbox in the *Data type* field to select a data type.�h]�hV)��}�(hjD h]�(hJ�!Use the drop-down listbox in the �����}�(h jF h!hh"NhNubh`)��}�(h�*Data type*�h]�hJ� Data type�����}�(h jM h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jF ubhJ� field to select a data type.�����}�(h jF h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK/h jB ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK/h j? ubjR )��}�(h��Use the drop-down listbox in the *Mode* field to select a mode. Select *IN*62for an input parameter; select *OUT* for an output parameter; select *INOUT*63for both an input and an output parameter; or, select *VARIADIC* to specify a64VARIADIC parameter.�h]�hV)��}�(h��Use the drop-down listbox in the *Mode* field to select a mode. Select *IN*65for an input parameter; select *OUT* for an output parameter; select *INOUT*66for both an input and an output parameter; or, select *VARIADIC* to specify a67VARIADIC parameter.�h]�(hJ�!Use the drop-down listbox in the �����}�(h jo h!hh"NhNubh`)��}�(h�*Mode*�h]�hJ�Mode�����}�(h jw h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ� field to select a mode. Select �����}�(h jo h!hh"NhNubh`)��}�(h�*IN*�h]�hJ�IN�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ� 68for an input parameter; select �����}�(h jo h!hh"NhNubh`)��}�(h�*OUT*�h]�hJ�OUT�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ�! for an output parameter; select �����}�(h jo h!hh"NhNubh`)��}�(h�*INOUT*�h]�hJ�INOUT�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ�769for both an input and an output parameter; or, select �����}�(h jo h!hh"NhNubh`)��}�(h�70*VARIADIC*�h]�hJ�VARIADIC�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ�! to specify a71VARIADIC parameter.�����}�(h jo h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK0h jk ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK0h j? ubjR )��}�(h�=Provide a name for the argument in the *Argument Name* field.�h]�hV)��}�(hj� h]�(hJ�'Provide a name for the argument in the �����}�(h j� h!hh"NhNubh`)��}�(h�*Argument Name*�h]�hJ�
Argument Name�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� field.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK4h j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK4h j? ubjR )��}�(h�GSpecify a default value for the argument in the *Default Value* field.72�h]�hV)��}�(h�FSpecify a default value for the argument in the *Default Value* field.�h]�(hJ�0Specify a default value for the argument in the �����}�(h j73 h!hh"NhNubh`)��}�(h�*Default Value*�h]�hJ�
Default Value�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j74 ubhJ� field.�����}�(h j75 h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK5h j ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK5h j? ubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK/h j ubeh}�(h]�h]�h]�h]�h]�uhjQ h"h#hK,h je h!hubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK&h h&h!hubhV)��}�(h��Click the *Add* icon (+) to define another argument; to discard an argument,76click the trash icon to the left of the row and confirm deletion in the *Delete77Row* popup.�h]�(hJ�78Click the �����}�(h jB h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h jJ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jB ubhJ�� icon (+) to define another argument; to discard an argument,79click the trash icon to the left of the row and confirm deletion in the �����}�(h jB h!hh"NhNubh`)��}�(h�*Delete80Row*�h]�hJ�81Delete82Row�����}�(h j\ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jB ubhJ� popup.�����}�(h jB h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK7h h&h!hubhV)��}�(h�!Click the *Code* tab to continue.�h]�(hJ�83Click the �����}�(h jt h!hh"NhNubh`)��}�(h�*Code*�h]�hJ�Code�����}�(h j| h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jt ubhJ� tab to continue.�����}�(h jt h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK;h h&h!hubj )��}�(h�Z.. image:: images/function_code.png84 :alt: Function dialog code tab85 :align: center86�h]�h}�(h]�h]�h]�h]�h]��alt��Function dialog code tab��align��center��uri��images/function_code.png�j) }�j+ j� suhj h"h#hK=h h&h!hubjM )��}�(hhh]�jR )��}�(h�VUse the *Code* field to write the code that will execute when the function87is called.88�h]�hV)��}�(h�UUse the *Code* field to write the code that will execute when the function89is called.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�*Code*�h]�hJ�Code�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�G field to write the code that will execute when the function90is called.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKAh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKAh j� h!hubah}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hKAh h&h!hubhV)��}�(h�$Click the *Options* tab to continue.�h]�(hJ�91Click the �����}�(h j� h!hh"NhNubh`)��}�(h� *Options*�h]�hJ�Options�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� tab to continue.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKDh h&h!hubj )��}�(h�`.. image:: images/function_options.png92 :alt: Function dialog options tab93 :align: center94�h]�h}�(h]�h]�h]�h]�h]��alt��Function dialog options tab��align��center��uri��images/function_options.png�j) }�j+ j suhj h"h#hKFh h&h!hubhV)��}�(h�UUse the fields in the *Options* tab to describe or modify the action of the95function:�h]�(hJ�Use the fields in the �����}�(h j h!hh"NhNubh`)��}�(h� *Options*�h]�hJ�Options�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�6 tab to describe or modify the action of the96function:�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKJh h&h!hubjM )��}�(hhh]�(jR )��}�(hXA Use the drop-down listbox next to *Volatility* to select one of the following.97*VOLATILE* is the default value.98 99 * *VOLATILE* indicates that the function value can change even within a100 single table scan, so no optimizations can be made.101 * *STABLE* indicates that the function cannot modify the database, and that102 within a single table scan it will consistently return the same result for103 the same argument values.104 * *IMMUTABLE* indicates that the function cannot modify the database and105 always returns the same result when given the same argument values.106�h]�(hV)��}�(h�oUse the drop-down listbox next to *Volatility* to select one of the following.107*VOLATILE* is the default value.�h]�(hJ�"Use the drop-down listbox next to �����}�(h j0 h!hh"NhNubh`)��}�(h�*Volatility*�h]�hJ�108Volatility�����}�(h j8 h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j0 ubhJ�! to select one of the following.109�����}�(h j0 h!hh"NhNubh`)��}�(h�110*VOLATILE*�h]�hJ�VOLATILE�����}�(h jJ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j0 ubhJ� is the default value.�����}�(h j0 h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKMh j, ubh �block_quote���)��}�(hX� * *VOLATILE* indicates that the function value can change even within a111 single table scan, so no optimizations can be made.112* *STABLE* indicates that the function cannot modify the database, and that113 within a single table scan it will consistently return the same result for114 the same argument values.115* *IMMUTABLE* indicates that the function cannot modify the database and116 always returns the same result when given the same argument values.117�h]�jM )��}�(hhh]�(jR )��}�(h�y*VOLATILE* indicates that the function value can change even within a118single table scan, so no optimizations can be made.�h]�hV)��}�(h�y*VOLATILE* indicates that the function value can change even within a119single table scan, so no optimizations can be made.�h]�(h`)��}�(h�120*VOLATILE*�h]�hJ�VOLATILE�����}�(h js h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ�o indicates that the function value can change even within a121single table scan, so no optimizations can be made.�����}�(h jo h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKPh jk ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKPh jh ubjR )��}�(h��*STABLE* indicates that the function cannot modify the database, and that122within a single table scan it will consistently return the same result for123the same argument values.�h]�hV)��}�(h��*STABLE* indicates that the function cannot modify the database, and that124within a single table scan it will consistently return the same result for125the same argument values.�h]�(h`)��}�(h�*STABLE*�h]�hJ�STABLE�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�� indicates that the function cannot modify the database, and that126within a single table scan it will consistently return the same result for127the same argument values.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKRh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKRh jh ubjR )��}�(h��*IMMUTABLE* indicates that the function cannot modify the database and128always returns the same result when given the same argument values.129�h]�hV)��}�(h��*IMMUTABLE* indicates that the function cannot modify the database and130always returns the same result when given the same argument values.�h]�(h`)��}�(h�*IMMUTABLE*�h]�hJ� IMMUTABLE�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� indicates that the function cannot modify the database and131always returns the same result when given the same argument values.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKUh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKUh jh ubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hKPh jd ubah}�(h]�h]�h]�h]�h]�uhjb h"h#hKPh j, ubeh}�(h]�h]�h]�h]�h]�uhjQ h"h#hKMh j) h!hubjR )��}�(h�|Move the *Returns a Set?* switch to indicate if the function returns a set132that includes multiple rows. The default is *No*.�h]�hV)��}�(h�|Move the *Returns a Set?* switch to indicate if the function returns a set133that includes multiple rows. The default is *No*.�h]�(hJ� Move the �����}�(h j� h!hh"NhNubh`)��}�(h�*Returns a Set?*�h]�hJ�Returns a Set?�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�^ switch to indicate if the function returns a set134that includes multiple rows. The default is �����}�(h j� h!hh"NhNubh`)��}�(h�*No*�h]�hJ�No�����}�(h j
h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKXh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKXh j) h!hubjR )��}�(h��Move the *Strict?* switch to indicate if the function always returns NULL135whenever any of its arguments are NULL. If *Yes*, the function is not executed136when there are NULL arguments; instead a NULL result is assumed137automatically. The default is *No*.�h]�hV)��}�(h��Move the *Strict?* switch to indicate if the function always returns NULL138whenever any of its arguments are NULL. If *Yes*, the function is not executed139when there are NULL arguments; instead a NULL result is assumed140automatically. The default is *No*.�h]�(hJ� Move the �����}�(h j/ h!hh"NhNubh`)��}�(h� *Strict?*�h]�hJ�Strict?�����}�(h j7 h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j/ ubhJ�c switch to indicate if the function always returns NULL141whenever any of its arguments are NULL. If �����}�(h j/ h!hh"NhNubh`)��}�(h�*Yes*�h]�hJ�Yes�����}�(h jI h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j/ ubhJ�}, the function is not executed142when there are NULL arguments; instead a NULL result is assumed143automatically. The default is �����}�(h j/ h!hh"NhNubh`)��}�(h�*No*�h]�hJ�No�����}�(h j[ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j/ ubhJ�.�����}�(h j/ h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKZh j+ ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKZh j) h!hubjR )��}�(h��Move the *Security of definer?* switch to specify that the function is to be144executed with the privileges of the user that created it. The default is *No*.�h]�hV)��}�(h��Move the *Security of definer?* switch to specify that the function is to be145executed with the privileges of the user that created it. The default is *No*.�h]�(hJ� Move the �����}�(h j} h!hh"NhNubh`)��}�(h�*Security of definer?*�h]�hJ�Security of definer?�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j} ubhJ�w switch to specify that the function is to be146executed with the privileges of the user that created it. The default is �����}�(h j} h!hh"NhNubh`)��}�(h�*No*�h]�hJ�No�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j} ubhJ�.�����}�(h j} h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK^h jy ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK^h j) h!hubjR )��}�(hX� Move the *Window?* switch to indicate that the function is a window function147rather than a plain function. The default is *No*. This is currently only148useful for functions written in C. The WINDOW attribute cannot be changed when149replacing an existing function definition. For more information about the150CREATE FUNCTION command, see the PostgreSQL core documentation available at:151 152 https://www.postgresql.org/docs/current/functions-window.html153�h]�(hV)��}�(hX| Move the *Window?* switch to indicate that the function is a window function154rather than a plain function. The default is *No*. This is currently only155useful for functions written in C. The WINDOW attribute cannot be changed when156replacing an existing function definition. For more information about the157CREATE FUNCTION command, see the PostgreSQL core documentation available at:�h]�(hJ� Move the �����}�(h j� h!hh"NhNubh`)��}�(h� *Window?*�h]�hJ�Window?�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�h switch to indicate that the function is a window function158rather than a plain function. The default is �����}�(h j� h!hh"NhNubh`)��}�(h�*No*�h]�hJ�No�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ��. This is currently only159useful for functions written in C. The WINDOW attribute cannot be changed when160replacing an existing function definition. For more information about the161CREATE FUNCTION command, see the PostgreSQL core documentation available at:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK`h j� ubjc )��}�(h�>https://www.postgresql.org/docs/current/functions-window.html162�h]�hV)��}�(h�=https://www.postgresql.org/docs/current/functions-window.html�h]�h � reference���)��}�(hj� h]�hJ�=https://www.postgresql.org/docs/current/functions-window.html�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]��refuri�j� uhj� h j� ubah}�(h]�h]�h]�h]�h]�uhhUh"h#hKfh j� ubah}�(h]�h]�h]�h]�h]�uhjb h"h#hKfh j� ubeh}�(h]�h]�h]�h]�h]�uhjQ h"h#hK`h j) h!hubjR )��}�(h��Use the *Estimated cost* field to specify a positive number representing the163estimated execution cost for the function, in units of cpu_operator_cost. If164the function returns a set, this is the cost per returned row.�h]�hV)��}�(h��Use the *Estimated cost* field to specify a positive number representing the165estimated execution cost for the function, in units of cpu_operator_cost. If166the function returns a set, this is the cost per returned row.�h]�(hJ�Use the �����}�(h j h!hh"NhNubh`)��}�(h�*Estimated cost*�h]�hJ�Estimated cost�����}�(h j! h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�� field to specify a positive number representing the167estimated execution cost for the function, in units of cpu_operator_cost. If168the function returns a set, this is the cost per returned row.�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKhh j ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKhh j) h!hubjR )��}�(hX Use the *Estimated rows* field to specify a positive number giving the169estimated number of rows that the query planner should expect the function to170return. This is only allowed when the function is declared to return a set.171The default assumption is 1000 rows.�h]�hV)��}�(hX Use the *Estimated rows* field to specify a positive number giving the172estimated number of rows that the query planner should expect the function to173return. This is only allowed when the function is declared to return a set.174The default assumption is 1000 rows.�h]�(hJ�Use the �����}�(h jC h!hh"NhNubh`)��}�(h�*Estimated rows*�h]�hJ�Estimated rows�����}�(h jK h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jC ubhJ�� field to specify a positive number giving the175estimated number of rows that the query planner should expect the function to176return. This is only allowed when the function is declared to return a set.177The default assumption is 1000 rows.�����}�(h jC h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKkh j? ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKkh j) h!hubjR )��}�(h��Move the *Leak proof?* switch to indicate whether the function has side178effects. The default is *No*. This option can only be set by the superuser.�h]�hV)��}�(h��Move the *Leak proof?* switch to indicate whether the function has side179effects. The default is *No*. This option can only be set by the superuser.�h]�(hJ� Move the �����}�(h jm h!hh"NhNubh`)��}�(h�
*Leak proof?*�h]�hJ�Leak proof?�����}�(h ju h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jm ubhJ�J switch to indicate whether the function has side180effects. The default is �����}�(h jm h!hh"NhNubh`)��}�(h�*No*�h]�hJ�No�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jm ubhJ�/. This option can only be set by the superuser.�����}�(h jm h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKoh ji ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKoh j) h!hubjR )��}�(h�`Use the *Support function* field to specify a planner support function to181use for the function.182�h]�hV)��}�(h�_Use the *Support function* field to specify a planner support function to183use for the function.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�*Support function*�h]�hJ�Support function�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�E field to specify a planner support function to184use for the function.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKqh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKqh j) h!hubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hKMh h&h!hubhV)��}�(h�'Click the *Parameters* tab to continue.�h]�(hJ�185Click the �����}�(h j� h!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�186Parameters�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� tab to continue.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKth h&h!hubj )��}�(h�f.. image:: images/function_parameters.png187 :alt: Function dialog parameters tab188 :align: center189�h]�h}�(h]�h]�h]�h]�h]��alt��Function dialog parameters tab��align��center��uri��images/function_parameters.png�j) }�j+ j suhj h"h#hKvh h&h!hubhV)��}�(h��Use the fields in the *Parameters* tab to specify settings that will be applied190when the function is invoked. Click the *Add* icon (+) to add a *Name*/*Value*191field in the table.�h]�(hJ�Use the fields in the �����}�(h j h!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�192Parameters�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�V tab to specify settings that will be applied193when the function is invoked. Click the �����}�(h j h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ� icon (+) to add a �����}�(h j h!hh"NhNubh`)��}�(h�*Name*�h]�hJ�Name�����}�(h j2 h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�/�����}�(h j h!hh"NhNubh`)��}�(h�*Value*�h]�hJ�Value�����}�(h jD h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�194field in the table.�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKzh h&h!hubjM )��}�(hhh]�(jR )��}�(h�_Use the drop-down listbox in the *Name* column in the *Parameters* panel to195select a parameter.�h]�hV)��}�(h�_Use the drop-down listbox in the *Name* column in the *Parameters* panel to196select a parameter.�h]�(hJ�!Use the drop-down listbox in the �����}�(h jc h!hh"NhNubh`)��}�(h�*Name*�h]�hJ�Name�����}�(h jk h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jc ubhJ� column in the �����}�(h jc h!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�197Parameters�����}�(h j} h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jc ubhJ� panel to198select a parameter.�����}�(h jc h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK~h j_ ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK~h j\ h!hubjR )��}�(h��Use the *Value* field to specify the value that will be associated with the199selected variable. This field is context-sensitive.200�h]�hV)��}�(h�Use the *Value* field to specify the value that will be associated with the201selected variable. This field is context-sensitive.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�*Value*�h]�hJ�Value�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�p field to specify the value that will be associated with the202selected variable. This field is context-sensitive.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK�h j\ h!hubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK~h h&h!hubhV)��}�(h�%Click the *Security* tab to continue.�h]�(hJ�203Click the �����}�(h j� h!hh"NhNubh`)��}�(h�204*Security*�h]�hJ�Security�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� tab to continue.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubj )��}�(h�b.. image:: images/function_security.png205 :alt: Function dialog security tab206 :align: center207�h]�h}�(h]�h]�h]�h]�h]��alt��Function dialog security tab��align��center��uri��images/function_security.png�j) }�j+ j� suhj h"h#hK�h h&h!hubhV)��}�(h�GUse the *Security* tab to assign privileges and define security labels.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�208*Security*�h]�hJ�Security�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�5 tab to assign privileges and define security labels.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubhV)��}�(h�QUse the *Privileges* panel to assign usage privileges for the function to a209role.�h]�(hJ�Use the �����}�(h j h!hh"NhNubh`)��}�(h�*Privileges*�h]�hJ�210Privileges�����}�(h j$ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�= panel to assign usage privileges for the function to a211role.�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubjM )��}�(hhh]�(jR )��}�(h�NSelect the name of the role from the drop-down listbox in the *Grantee* field.�h]�hV)��}�(hjA h]�(hJ�>Select the name of the role from the drop-down listbox in the �����}�(h jC h!hh"NhNubh`)��}�(h� *Grantee*�h]�hJ�Grantee�����}�(h jJ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jC ubhJ� field.�����}�(h jC h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h j? ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK�h j< h!hubjR )��}�(h��Click inside the *Privileges* field. Check the boxes to the left of one or212more privileges to grant the selected privilege to the specified user.�h]�hV)��}�(h��Click inside the *Privileges* field. Check the boxes to the left of one or213more privileges to grant the selected privilege to the specified user.�h]�(hJ�Click inside the �����}�(h jl h!hh"NhNubh`)��}�(h�*Privileges*�h]�hJ�214Privileges�����}�(h jt h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�t field. Check the boxes to the left of one or215more privileges to grant the selected privilege to the specified user.�����}�(h jl h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h jh ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK�h j< h!hubjR )��}�(h�nThe current user, who is the default grantor for granting the privilege, is displayed in the *Grantor* field.216�h]�hV)��}�(h�mThe current user, who is the default grantor for granting the privilege, is displayed in the *Grantor* field.�h]�(hJ�]The current user, who is the default grantor for granting the privilege, is displayed in the �����}�(h j� h!hh"NhNubh`)��}�(h� *Grantor*�h]�hJ�Grantor�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� field.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK�h j< h!hubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK�h h&h!hubhV)��}�(h��Click the *Add* icon (+) to assign additional privileges; to discard a217privilege, click the trash icon to the left of the row and confirm deletion in218the *Delete Row* popup.�h]�(hJ�219Click the �����}�(h j� h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�� icon (+) to assign additional privileges; to discard a220privilege, click the trash icon to the left of the row and confirm deletion in221the �����}�(h j� h!hh"NhNubh`)��}�(h�*Delete Row*�h]�hJ�222Delete Row�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� popup.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubhV)��}�(h��Use the *Security Labels* panel to define security labels applied to the223function. Click the *Add* icon (+) to add each security label selection:�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�*Security Labels*�h]�hJ�Security Labels�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�D panel to define security labels applied to the224function. Click the �����}�(h j� h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h j225