Update Triggers accessing new values and intercepting.

Поиск
Список
Период
Сортировка
От Larry Silvermintz
Тема Update Triggers accessing new values and intercepting.
Дата
Msg-id CFA9C190AAC642CDBDD8D732F88BB63F@LARRY
обсуждение исходный текст
Список pgsql-novice

Please help explain how to use triggers with LANGUAGE SQL to enforce assertions or complex schema-wide multiple-table constraints, firing “before ... on insert or update”.

Perhaps this is also a topic for the Documentation forum, as it doesn’t seem to be present in the current docs.

Are there functionalities only available in functions written in LANGUAGE SQL (my preference) or conversely, any which are unavailable when implementing the handler function with SQL?

* How can the function access the values from the triggering insert/update statement? 

* What does it mean to specify “RETURNS TRIGGER”?

* Specifically, Do I specify the return type (s) somehow? 

* How does one specify the values to be returned?

* HOw, based upon the outcome of the function, can the original statement’s values either be used to complete the insert/update, or else be discarded?

* Is there a way to generate an error message, like those reported when a regular check constraint is violated?

** Where can I find examples of such constraint-enforcing triggers implemented in Language SQL?

 

Most appreciatively,

Larry Silvermintz

LarryS@ucla.edu

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: postgres C function returning SETOF record gives RECORD TYPE NOT REGISTERED
Следующее
От: Brent Austin
Дата:
Сообщение: self-contained db for osx app