a row not deletes
От | Rafał Pietrak |
---|---|
Тема | a row not deletes |
Дата | |
Msg-id | 535CBE76.7030909@ztk-rp.eu обсуждение исходный текст |
Ответы |
Re: a row not deletes
|
Список | pgsql-general |
Hi the list, I've just experienced an unexpected (for me) "loss" of DELETE. Is this a feature or a bug (postgres v.s. SQL)? -------------------- test case ------------------------- test=# CREATE TABLE test (a int, b text); test=# INSERT INTO test (a,b) values (1,'asd'); test=# INSERT INTO test (a,b) values (2,'dfg'); test=# INSERT INTO test (a,b) values (3,'ghj'); test=# CREATE or replace FUNCTION test_del () returns trigger language plpgsql as $$ begin update test t set b = 'will delete this' where t.a=old.a; return old; end; $$; test=# CREATE TRIGGER test_trig BEFORE DELETE ON test for each row execute procedure test_del(); test=# DELETE FROM test where a=2; DELETE 0 test=# SELECT * from test; a | b ----+----- 1 | asd 3 | ghj 2 | will delete this (3 rows) -------------------------------------------------------- e.g.: an indicated row is not deleted, despite the fact, that the selector wasn't changed by the intermediate UPDATE. I understand, that the bucket was changed by the update, but should that matter? -R
В списке pgsql-general по дате отправления: