Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
34.55. triggers
Prev UpChapter 34. The Information SchemaHome Next

34.55. triggers

The viewtriggers contains all triggers defined in the current database on tables and views that the current user owns or has some privilege other thanSELECT on.

Table 34.53. triggers Columns

NameData TypeDescription
trigger_catalogsql_identifierName of the database that contains the trigger (always the current database)
trigger_schemasql_identifierName of the schema that contains the trigger
trigger_namesql_identifierName of the trigger
event_manipulationcharacter_data Event that fires the trigger (INSERT,UPDATE, orDELETE)
event_object_catalogsql_identifier Name of the database that contains the table that the trigger is defined on (always the current database)
event_object_schemasql_identifierName of the schema that contains the table that the trigger is defined on
event_object_tablesql_identifierName of the table that the trigger is defined on
action_ordercardinal_numberNot yet implemented
action_conditioncharacter_dataWHEN condition of the trigger, null if none (also null if the table is not owned by a currently enabled role)
action_statementcharacter_data Statement that is executed by the trigger (currently alwaysEXECUTE PROCEDUREfunction(...))
action_orientationcharacter_data Identifies whether the trigger fires once for each processed row or once for each statement (ROW orSTATEMENT)
action_timingcharacter_data Time at which the trigger fires (BEFORE,AFTER, orINSTEAD OF)
action_reference_old_tablesql_identifierApplies to a feature not available inPostgres Pro
action_reference_new_tablesql_identifierApplies to a feature not available inPostgres Pro
action_reference_old_rowsql_identifierApplies to a feature not available inPostgres Pro
action_reference_new_rowsql_identifierApplies to a feature not available inPostgres Pro
createdtime_stampApplies to a feature not available inPostgres Pro

Triggers inPostgres Pro have two incompatibilities with the SQL standard that affect the representation in the information schema. First, trigger names are local to each table inPostgres Pro, rather than being independent schema objects. Therefore there can be duplicate trigger names defined in one schema, so long as they belong to different tables. (trigger_catalog andtrigger_schema are really the values pertaining to the table that the trigger is defined on.) Second, triggers can be defined to fire on multiple events inPostgres Pro (e.g.,ON INSERT OR UPDATE), whereas the SQL standard only allows one. If a trigger is defined to fire on multiple events, it is represented as multiple rows in the information schema, one for each type of event. As a consequence of these two issues, the primary key of the viewtriggers is really(trigger_catalog, trigger_schema, event_object_table, trigger_name, event_manipulation) instead of(trigger_catalog, trigger_schema, trigger_name), which is what the SQL standard specifies. Nonetheless, if you define your triggers in a manner that conforms with the SQL standard (trigger names unique in the schema and only one event type per trigger), this will not affect you.

Note

Prior toPostgreSQL 9.1, this view's columnsaction_timing,action_reference_old_table,action_reference_new_table,action_reference_old_row, andaction_reference_new_row were namedcondition_timing,condition_reference_old_table,condition_reference_new_table,condition_reference_old_row, andcondition_reference_new_row respectively. That was how they were named in the SQL:1999 standard. The new naming conforms to SQL:2003 and later.


Prev Up Next
34.54. triggered_update_columns Home 34.56. udt_privileges
epubpdf
Go to Postgres Pro Standard 10
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp