codekingpro/portable-devtools
114k
1��� �sphinx.addnodes��document���)��}�(� rawsource�� ��children�]�(�docutils.nodes��target���)��}�(h�.. _trigger_function_dialog:�h]��2attributes�}�(�ids�]��classes�]��names�]��dupnames�]��backrefs�]��refid��trigger-function-dialog�u�tagname�h3�line�K�parent�h� _document�h�source��rD:\a\pgadmin-packaging-foundation\pgadmin-packaging-foundation\pgadmin4-8.6\docs\en_US\trigger_function_dialog.rst�ubh �section���)��}�(hhh]�(h �title���)��}�(h� `Trigger Function Dialog`:index:�h]�(h �index���)��}�(hhh]�h}�(h]�h]�h]�h]�h]��entries�]�(�single��Trigger Function Dialog��index-0�hNt�auhh/h"h#hKh h+ubh)��}�(hhh]�h}�(h]�h>ah]�h]�h]�h]�uhh4h h+ubh �Text����Trigger Function Dialog�����}�(h h+h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhh)h h&h!hh"h#hKubh � paragraph���)��}�(h��Use the *Trigger function* dialog to create or manage a trigger_function. A5trigger function defines the action that will be invoked when a trigger fires.�h]�(hJ�Use the �����}�(h hWh!hh"NhNubh �emphasis���)��}�(h�*Trigger function*�h]�hJ�Trigger function�����}�(h hah!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hWubhJ�� dialog to create or manage a trigger_function. A6trigger function defines the action that will be invoked when a trigger fires.�����}�(h hWh!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh h&h!hubhV)��}�(h��The *Trigger function* dialog organizes the development of a trigger function7through the following dialog tabs: *General*, *Definition*, *Code*, *Options*,8*Parameters* and *Security*. The *SQL* tab displays the SQL code generated by9dialog selections.�h]�(hJ�The �����}�(h hyh!hh"NhNubh`)��}�(h�*Trigger function*�h]�hJ�Trigger function�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ�[ dialog organizes the development of a trigger function10through the following 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�11Definition�����}�(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�,12�����}�(h hyh!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�13Parameters�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h hyubhJ� and �����}�(h hyh!hh"NhNubh`)��}�(h�14*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 by15dialog selections.�����}�(h hyh!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK16h h&h!hubh �image���)��}�(h�p.. image:: images/trigger_function_general.png17 :alt: Trigger function dialog general tab18 :align: center19�h]�h}�(h]�h]�h]�h]�h]��alt��#Trigger function dialog general tab��align��center��uri��#images/trigger_function_general.png��20candidates�}��*�j( suhj h"h#hKh h&h!hubhV)��}�(h�EUse the fields in the *General* tab to identify the trigger 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 the trigger function:�����}�(h j, h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKh h&h!hubh �bullet_list���)��}�(hhh]�(h � list_item���)��}�(h��Use the *Name* field to add a descriptive name for the trigger function. The21name will be displayed in the *pgAdmin* tree control. Please note that trigger22functions will be invoked in alphabetical order.�h]�hV)��}�(h��Use the *Name* field to add a descriptive name for the trigger function. The23name will be displayed in the *pgAdmin* tree control. Please note that trigger24functions will be invoked in alphabetical order.�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�] field to add a descriptive name for the trigger function. The25name will be 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�X tree control. Please note that trigger26functions will be invoked in alphabetical order.�����}�(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�`Use the drop-down listbox next to *Owner* to select the role that will own the27trigger function.�h]�hV)��}�(h�`Use the drop-down listbox next to *Owner* to select the role that will own the28trigger 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�7 to select the role that will own the29trigger 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�ySelect the name of the schema in which the trigger function will reside from30the drop-down listbox in the *Schema* field.�h]�hV)��}�(h�ySelect the name of the schema in which the trigger function will reside from31the drop-down listbox in the *Schema* field.�h]�(hJ�jSelect the name of the schema in which the trigger function will reside from32the drop-down listbox in the �����}�(h j� h!hh"NhNubh`)��}�(h�*Schema*�h]�hJ�Schema�����}�(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!hubjR )��}�(h�?Store notes about the trigger function in the *Comment* field.33�h]�hV)��}�(h�>Store notes about the trigger function in the *Comment* field.�h]�(hJ�.Store notes about the trigger 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�v.. image:: images/trigger_function_definition.png36 :alt: Trigger function dialog definition tab37 :align: center38�h]�h}�(h]�h]�h]�h]�h]��alt��&Trigger function dialog definition tab��align��center��uri��&images/trigger_function_definition.png�j) }�j+ jC suhj h"h#hK h h&h!hubhV)��}�(h�FUse the fields in the *Definition* tab to define the trigger 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 trigger function:�����}�(h jE h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK$h h&h!hubjM )��}�(hhh]�(jR )��}�(h��Use the drop-down listbox next to *Return type* to specify the pseudotype that40is associated with the trigger function:41 42 * Select *trigger* if you are creating a DML trigger.43 * Select *event_trigger* if you are creating a DDL trigger.44�h]�(hV)��}�(h�wUse the drop-down listbox next to *Return type* to specify the pseudotype that45is associated with the trigger function:�h]�(hJ�"Use the drop-down listbox next to �����}�(h jl h!hh"NhNubh`)��}�(h�
*Return type*�h]�hJ�Return type�����}�(h jt h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�H to specify the pseudotype that46is associated with the trigger function:�����}�(h jl h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK&h jh ubh �block_quote���)��}�(h�r* Select *trigger* if you are creating a DML trigger.47* Select *event_trigger* if you are creating a DDL trigger.48�h]�jM )��}�(hhh]�(jR )��}�(h�3Select *trigger* if you are creating a DML trigger.�h]�hV)��}�(hj� h]�(hJ�Select �����}�(h j� h!hh"NhNubh`)��}�(h� *trigger*�h]�hJ�trigger�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�# if you are creating a DML trigger.�����}�(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� ubjR )��}�(h�:Select *event_trigger* if you are creating a DDL trigger.49�h]�hV)��}�(h�9Select *event_trigger* if you are creating a DDL trigger.�h]�(hJ�Select �����}�(h j� h!hh"NhNubh`)��}�(h�*event_trigger*�h]�hJ�
event_trigger�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�# if you are creating a DDL trigger.�����}�(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� ubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK)h j� ubah}�(h]�h]�h]�h]�h]�uhj� h"h#hK)h jh ubeh}�(h]�h]�h]�h]�h]�uhjQ h"h#hK&h je h!hubjR )��}�(h�nUse the drop-down listbox next to *Language* to select the implementation50language. The default is *plpgsql*.51�h]�hV)��}�(h�mUse the drop-down listbox next to *Language* to select the implementation52language. The default is *plpgsql*.�h]�(hJ�"Use the drop-down listbox next to �����}�(h j� h!hh"NhNubh`)��}�(h�53*Language*�h]�hJ�Language�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�7 to select the implementation54language. The default is �����}�(h j� h!hh"NhNubh`)��}�(h� *plpgsql*�h]�hJ�plpgsql�����}�(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!hubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK&h h&h!hubhV)��}�(h�!Click the *Code* tab to continue.�h]�(hJ�55Click the �����}�(h j< h!hh"NhNubh`)��}�(h�*Code*�h]�hJ�Code�����}�(h jD 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�j.. image:: images/trigger_function_code.png56 :alt: Trigger function dialog code tab57 :align: center58�h]�h}�(h]�h]�h]�h]�h]��alt�� Trigger function dialog code tab��align��center��uri�� images/trigger_function_code.png�j) }�j+ jk suhj h"h#hK1h h&h!hubjM )��}�(hhh]�jR )��}�(h�^Use the *Code* field to write the code that will execute when the trigger59function is called.60�h]�hV)��}�(h�]Use the *Code* field to write the code that will execute when the trigger61function is called.�h]�(hJ�Use 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�O field to write the code that will execute when the trigger62function is called.�����}�(h jt h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK5h jp ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hK5h jm h!hubah}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hK5h h&h!hubhV)��}�(h�$Click the *Options* tab to continue.�h]�(hJ�63Click 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#hK8h h&h!hubj )��}�(h�p.. image:: images/trigger_function_options.png64 :alt: Trigger function dialog options tab65 :align: center66�h]�h}�(h]�h]�h]�h]�h]��alt��#Trigger function dialog options tab��align��center��uri��#images/trigger_function_options.png�j) }�j+ j� suhj h"h#hK:h h&h!hubhV)��}�(h�]Use the fields in the *Options* tab to describe or modify the action of the67trigger function:�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�> tab to describe or modify the action of the68trigger function:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK>h h&h!hubjM )��}�(hhh]�(jR )��}�(hX Use the drop-down listbox next to *Volatility* to select one of the following:69 70 * *VOLATILE* indicates that the trigger function value can change even71 within a single table scan.72 * *STABLE* indicates that the trigger function cannot modify the database,73 and that within a single table scan it will consistently return the same74 result for the same argument values.75 * *IMMUTABLE* indicates that the trigger function cannot modify the database76 and always returns the same result when given the same argument values.77�h]�(hV)��}�(h�NUse the drop-down listbox next to *Volatility* to select one of the following:�h]�(hJ�"Use the drop-down listbox next to �����}�(h j� h!hh"NhNubh`)��}�(h�*Volatility*�h]�hJ�78Volatility�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� to select one of the following:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKAh j� ubj� )��}�(hX� * *VOLATILE* indicates that the trigger function value can change even79 within a single table scan.80* *STABLE* indicates that the trigger function cannot modify the database,81 and that within a single table scan it will consistently return the same82 result for the same argument values.83* *IMMUTABLE* indicates that the trigger function cannot modify the database84 and always returns the same result when given the same argument values.85�h]�jM )��}�(hhh]�(jR )��}�(h�`*VOLATILE* indicates that the trigger function value can change even86within a single table scan.�h]�hV)��}�(h�`*VOLATILE* indicates that the trigger function value can change even87within a single table scan.�h]�(h`)��}�(h�88*VOLATILE*�h]�hJ�VOLATILE�����}�(h j' h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j# ubhJ�V indicates that the trigger function value can change even89within a single table scan.�����}�(h j# h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKCh j ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKCh j ubjR )��}�(h��*STABLE* indicates that the trigger function cannot modify the database,90and that within a single table scan it will consistently return the same91result for the same argument values.�h]�hV)��}�(h��*STABLE* indicates that the trigger function cannot modify the database,92and that within a single table scan it will consistently return the same93result for the same argument values.�h]�(h`)��}�(h�*STABLE*�h]�hJ�STABLE�����}�(h jM h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jI ubhJ�� indicates that the trigger function cannot modify the database,94and that within a single table scan it will consistently return the same95result for the same argument values.�����}�(h jI h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKEh jE ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKEh j ubjR )��}�(h��*IMMUTABLE* indicates that the trigger function cannot modify the database96and always returns the same result when given the same argument values.97�h]�hV)��}�(h��*IMMUTABLE* indicates that the trigger function cannot modify the database98and always returns the same result when given the same argument values.�h]�(h`)��}�(h�*IMMUTABLE*�h]�hJ� IMMUTABLE�����}�(h js h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jo ubhJ�� indicates that the trigger function cannot modify the database99and always returns the same result when given the same argument values.�����}�(h jo h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKHh jk ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKHh j ubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hKCh j ubah}�(h]�h]�h]�h]�h]�uhj� h"h#hKCh j� ubeh}�(h]�h]�h]�h]�h]�uhjQ h"h#hKAh j� h!hubjR )��}�(h��Move the *Returns a Set?* switch to indicate if the trigger function returns a100set that includes multiple rows. The default is *No*.�h]�hV)��}�(h��Move the *Returns a Set?* switch to indicate if the trigger function returns a101set that 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�f switch to indicate if the trigger function returns a102set that 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#hKKh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKKh j� h!hubjR )��}�(hX Move the *Strict?* switch to indicate if the trigger function always returns103NULL whenever any of its arguments are NULL. If *Yes*, the function is not104executed when there are NULL arguments; instead a NULL result is assumed105automatically. The default is *No*.�h]�hV)��}�(hX Move the *Strict?* switch to indicate if the trigger function always returns106NULL whenever any of its arguments are NULL. If *Yes*, the function is not107executed when there are NULL arguments; instead a NULL result is assumed108automatically. The default is *No*.�h]�(hJ� Move the �����}�(h j� h!hh"NhNubh`)��}�(h� *Strict?*�h]�hJ�Strict?�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�k switch to indicate if the trigger function always returns109NULL whenever any of its arguments are NULL. If �����}�(h j� h!hh"NhNubh`)��}�(h�*Yes*�h]�hJ�Yes�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�}, the function is not110executed when there are NULL arguments; instead a NULL result is assumed111automatically. 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#hKMh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKMh j� h!hubjR )��}�(h��Move the *Security of definer?* switch to specify that the trigger function112is to be executed with the privileges of the user that created it. The default113is *No*.�h]�hV)��}�(h��Move the *Security of definer?* switch to specify that the trigger function114is to be executed with the privileges of the user that created it. The default115is *No*.�h]�(hJ� Move the �����}�(h j1 h!hh"NhNubh`)��}�(h�*Security of definer?*�h]�hJ�Security of definer?�����}�(h j9 h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j1 ubhJ� switch to specify that the trigger function116is to be executed with the privileges of the user that created it. The default117is �����}�(h j1 h!hh"NhNubh`)��}�(h�*No*�h]�hJ�No�����}�(h jK h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j1 ubhJ�.�����}�(h j1 h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKQh j- ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKQh j� h!hubjR )��}�(h��Move the *Window?* switch to indicate that the trigger function is a window118function rather than a plain function. The default is *No*. This is currently119only useful for trigger functions written in C.�h]�hV)��}�(h��Move the *Window?* switch to indicate that the trigger function is a window120function rather than a plain function. The default is *No*. This is currently121only useful for trigger functions written in C.�h]�(hJ� Move the �����}�(h jm h!hh"NhNubh`)��}�(h� *Window?*�h]�hJ�Window?�����}�(h ju h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jm ubhJ�p switch to indicate that the trigger function is a window122function rather than a plain function. 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�C. This is currently123only useful for trigger functions written in C.�����}�(h jm h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKTh ji ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKTh j� h!hubjR )��}�(h��Use the *Estimated cost* field to specify a positive number representing the124estimated execution cost for the trigger function, in units of125cpu_operator_cost. If the function returns a set, this is the cost per126returned row.�h]�hV)��}�(h��Use the *Estimated cost* field to specify a positive number representing the127estimated execution cost for the trigger function, in units of128cpu_operator_cost. If the function returns a set, this is the cost per129returned 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 the130estimated execution cost for the trigger function, in units of131cpu_operator_cost. If the function returns a set, this is the cost per132returned row.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKWh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKWh j� h!hubjR )��}�(hX
Use the *Estimated rows* field to specify a positive number giving the133estimated number of rows that the query planner should expect the trigger134function to return. This is only allowed when the function is declared to135return a set. The default assumption is 1000 rows.�h]�hV)��}�(hX
Use the *Estimated rows* field to specify a positive number giving the136estimated number of rows that the query planner should expect the trigger137function to return. This is only allowed when the function is declared to138return a set. The default assumption is 1000 rows.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�*Estimated rows*�h]�hJ�Estimated rows�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�� field to specify a positive number giving the139estimated number of rows that the query planner should expect the trigger140function to return. This is only allowed when the function is declared to141return a set. The default assumption is 1000 rows.�����}�(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!hubjR )��}�(h��Move the *Leak proof?* switch to indicate whether the trigger function has142side effects. The default is *No*. This option can only be set by the143superuser.144�h]�hV)��}�(h��Move the *Leak proof?* switch to indicate whether the trigger function has145side effects. The default is *No*. This option can only be set by the146superuser.�h]�(hJ� Move the �����}�(h j� h!hh"NhNubh`)��}�(h�
*Leak proof?*�h]�hJ�Leak proof?�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�R switch to indicate whether the trigger function has147side effects. 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 option can only be set by the148superuser.�����}�(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#hKAh h&h!hubhV)��}�(h�'Click the *Parameters* tab to continue.�h]�(hJ�149Click the �����}�(h j; h!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�150Parameters�����}�(h jC 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#hKch h&h!hubj )��}�(h�v.. image:: images/trigger_function_parameters.png151 :alt: Trigger function dialog parameters tab152 :align: center153�h]�h}�(h]�h]�h]�h]�h]��alt��&Trigger function dialog parameters tab��align��center��uri��&images/trigger_function_parameters.png�j) }�j+ jj suhj h"h#hKeh h&h!hubhV)��}�(h��Use the fields in the *Parameters* tab to specify settings that will be applied154when the trigger function is invoked. Click the *Add* icon (+) to add a155*Name*/*Value* pair to the table below.�h]�(hJ�Use the fields in the �����}�(h jl h!hh"NhNubh`)��}�(h�*Parameters*�h]�hJ�156Parameters�����}�(h jt h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�^ tab to specify settings that will be applied157when the trigger function is invoked. Click the �����}�(h jl h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ� icon (+) to add a158�����}�(h jl h!hh"NhNubh`)��}�(h�*Name*�h]�hJ�Name�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�/�����}�(h jl h!hh"NhNubh`)��}�(h�*Value*�h]�hJ�Value�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ� pair to the table below.�����}�(h jl h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKih h&h!hubjM )��}�(hhh]�(jR )��}�(h�DUse the drop-down listbox in the *Name* field to select a parameter.�h]�hV)��}�(hj� h]�(hJ�!Use the drop-down listbox in the �����}�(h j� h!hh"NhNubh`)��}�(h�*Name*�h]�hJ�Name�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� field to select a parameter.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKmh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKmh j� h!hubjR )��}�(h��Use the *Value* field to specify the value that will be associated with the159selected parameter. This field is context-sensitive.160�h]�hV)��}�(h��Use the *Value* field to specify the value that will be associated with the161selected parameter. 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�q field to specify the value that will be associated with the162selected parameter. This field is context-sensitive.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKnh j� ubah}�(h]�h]�h]�h]�h]�uhjQ h"h#hKnh j� h!hubeh}�(h]�h]�h]�h]�h]�j j+ uhjL h"h#hKmh h&h!hubhV)��}�(h��Click the *Add* icon (+) to set additional parameters; to discard a parameter,163click the trash icon to the left of the row and confirm deletion in the *Delete164Row* popup.�h]�(hJ�165Click 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 set additional parameters; to discard a parameter,166click the trash icon to the left of the row and confirm deletion in the �����}�(h j h!hh"NhNubh`)��}�(h�*Delete167Row*�h]�hJ�168Delete169Row�����}�(h j8 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#hKqh h&h!hubhV)��}�(h�%Click the *Security* tab to continue.�h]�(hJ�170Click the �����}�(h jP h!hh"NhNubh`)��}�(h�171*Security*�h]�hJ�Security�����}�(h jX h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jP ubhJ� tab to continue.�����}�(h jP h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hKuh h&h!hubj )��}�(h�r.. image:: images/trigger_function_security.png172 :alt: Trigger function dialog security tab173 :align: center174�h]�h}�(h]�h]�h]�h]�h]��alt��$Trigger function dialog security tab��align��center��uri��$images/trigger_function_security.png�j) }�j+ j suhj h"h#hKwh 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�175*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��Use the *Privileges* panel to assign usage privileges for the trigger function176to a role. Click the *Add* icon (+) to add a role to the table.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh`)��}�(h�*Privileges*�h]�hJ�177Privileges�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�P panel to assign usage privileges for the trigger function178to a role. 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 role to the table.�����}�(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)��}�(hj� h]�(hJ�>Select the name of the role from the drop-down listbox in the �����}�(h j� h!hh"NhNubh`)��}�(h� *Grantee*�h]�hJ�Grantee�����}�(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!hubjR )��}�(h��Click inside the *Privileges* field. Check the boxes to the left of one or179more 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 or180more privileges to grant the selected privilege to the specified user.�h]�(hJ�Click inside the �����}�(h j h!hh"NhNubh`)��}�(h�*Privileges*�h]�hJ�181Privileges�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j ubhJ�t field. Check the boxes to the left of one or182more privileges to grant the selected privilege to the specified user.�����}�(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!hubjR )��}�(h�nThe current user, who is the default grantor for granting the privilege, is displayed in the *Grantor* field.183�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 j5 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 a184privilege, click the trash icon to the left of the row and confirm deletion in185the *Delete Row* popup.�h]�(hJ�186Click the �����}�(h jY h!hh"NhNubh`)��}�(h�*Add*�h]�hJ�Add�����}�(h ja h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jY ubhJ�� icon (+) to assign additional privileges; to discard a187privilege, click the trash icon to the left of the row and confirm deletion in188the �����}�(h jY h!hh"NhNubh`)��}�(h�*Delete Row*�h]�hJ�189Delete Row�����}�(h js h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jY ubhJ� popup.�����}�(h jY 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 the trigger190function. 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�L panel to define security labels applied to the trigger191function. 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 each security label selection:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubjM )��}�(hhh]�(jR )��}�(h��Specify a security label provider in the *Provider* field. The named provider192must be loaded and must consent to the proposed labeling operation.�h]�hV)��}�(h��Specify a security label provider in the *Provider* field. The named provider193must be loaded and must consent to the proposed labeling operation.�h]�(hJ�)Specify a security label provider in the �����}�(h j� h!hh"NhNubh`)��}�(h�194*Provider*�h]�hJ�Provider�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�^ field. The named provider195must be loaded and must consent to the proposed labeling operation.�����}�(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!hubjR )��}�(hX Specify a a security label in the *Security Label* field. The meaning of a196given label is at the discretion of the label provider. PostgreSQL places no197restrictions on whether or how a label provider must interpret security198labels; it merely provides a mechanism for storing them.199�h]�hV)��}�(hX Specify a a security label in the *Security Label* field. The meaning of a200given label is at the discretion of the label provider. PostgreSQL places no201restrictions on whether or how a label provider must interpret security202labels; it merely provides a mechanism for storing them.�h]�(hJ�"Specify a a security label in the �����}�(h j� h!hh"NhNubh`)��}�(h�*Security Label*�h]�hJ�Security Label�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ�� field. The meaning of a203given label is at the discretion of the label provider. PostgreSQL places no204restrictions on whether or how a label provider must interpret security205labels; it merely provides a mechanism for storing them.�����}�(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 security labels; to discard a206security label, click the trash icon to the left of the row and confirm deletion207in the *Delete Row* popup.�h]�(hJ�208Click 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 security labels; to discard a209security label, click the trash icon to the left of the row and confirm deletion210in the �����}�(h j h!hh"NhNubh`)��}�(h�*Delete Row*�h]�hJ�211Delete Row�����}�(h j4 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� Click the *SQL* tab to continue.�h]�(hJ�212Click the �����}�(h jL h!hh"NhNubh`)��}�(h�*SQL*�h]�hJ�SQL�����}�(h jT h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jL ubhJ� tab to continue.�����}�(h jL h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubhV)��}�(h��Your entries in the *Trigger function* dialog generate a SQL command (see an213example below). Use the *SQL* tab for review; revisit other tabs to modify the214SQL command.�h]�(hJ�Your entries in the �����}�(h jl h!hh"NhNubh`)��}�(h�*Trigger function*�h]�hJ�Trigger function�����}�(h jt h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�? dialog generate a SQL command (see an215example below). Use the �����}�(h jl h!hh"NhNubh`)��}�(h�*SQL*�h]�hJ�SQL�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h jl ubhJ�> tab for review; revisit other tabs to modify the216SQL command.�����}�(h jl h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h h&h!hubh%)��}�(hhh]�(h*)��}�(h�Example�h]�hJ�Example�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh)h j� h!hh"h#hK�ubhV)��}�(h�mThe following is an example of the sql command generated by user selections in217the *Trigger function* dialog:�h]�(hJ�SThe following is an example of the sql command generated by user selections in218the �����}�(h j� h!hh"NhNubh`)��}�(h�*Trigger function*�h]�hJ�Trigger function�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh_h j� ubhJ� dialog:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhUh"h#hK�h j� h!hubj )��}�(h�h.. image:: images/trigger_function_sql.png219 :alt: Trigger function dialog sql tab220 :align: center221�h]�h}�(h]�h]�h]�h]�h]��alt��Trigger function dialog sql tab��align��center��uri��images/trigger_function_sql.png�j) }�j+ j� suhj h"h#hK�h j� h!hubhV)��}�(h�MThe example shown demonstrates creating a trigger function named *emp_stamp*.�h]�(hJ�AThe example shown demonstrates creating a trigger function named �����}�(h j� h!hh"NhNubh`)��}�(h�*emp_stamp*�h]�hJ� emp_stamp�����}�(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� h!hubjM )��}�(hhh]�(jR )��}�(h�2Click the *Info* button (i) to access online help.�h]�hV)��}�(hj222