Re: For each statement trigger and update table
| От | Rene Romero Benavides |
|---|---|
| Тема | Re: For each statement trigger and update table |
| Дата | |
| Msg-id | CANaGW0_f73YYd65mGETN3Qcpa5MnAe3DX_Tx1OFmpE36_6BxEQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | For each statement trigger and update table (Mike Martin <mike@redtux.plus.com>) |
| Ответы |
Re: For each statement trigger and update table
|
| Список | pgsql-sql |
Oh, so you're defining transition relations (REFERENCING NEW TABLE, OLD TABLE ) as in here?
CREATE TRIGGER paired_items_update AFTER UPDATE ON paired_items REFERENCING NEW TABLE AS newtab OLD TABLE AS oldtab FOR EACH ROW EXECUTE FUNCTION check_matching_pairs();
On Fri, Jan 3, 2020 at 5:55 PM Mike Martin <mike@redtux.plus.com> wrote:
According to the docs, not possible to use a transition table and column list togetherOn Fri, 3 Jan 2020, 23:39 Rene Romero Benavides, <rene.romero.b@gmail.com> wrote:> I can give code when I get home, but it's pretty simple stuffplease do so, along with your trigger definition. Are you aware that you can define your update trigger to fire on a specific column?For UPDATE events, it is possible to specify a list of columns using this syntax:
UPDATE OF column_name1 [, column_name2 ... ]On Fri, Jan 3, 2020 at 5:21 PM Mike Martin <mike@redtux.plus.com> wrote:Not sure if this is possibleBasically I want to have a trigger which updates an array column in the same table when a column is updatedThis works as a row level trigger, but not as per statementI have hit the recursive issue (where update fires update trigger which fires etc)According to the docs I cannot use columns and relative tables togetherSo any suggestions? I can give code when I get home, but it's pretty simple stuff--
В списке pgsql-sql по дате отправления: