Re: feature proposal - triggers by semantics
| От | Michael Paquier |
|---|---|
| Тема | Re: feature proposal - triggers by semantics |
| Дата | |
| Msg-id | CAB7nPqSf-tybcYEoukUPaY9SNaRnqMtxVucRDGEoLQVBOivFjQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | feature proposal - triggers by semantics (Darren Duncan <darren@darrenduncan.net>) |
| Список | pgsql-hackers |
A row-level trigger for TRUNCATE does not really make sense, as it would mean that TRUNCATE needs to scan each tuple of thetable it needs to interact with to fire its trigger, so it would more or less achieve the same performance as a plain"DELETE FROM table;".<br /><br />TRUNCATE is performant because it only removes the tuples, and does not care aboutscanning. I am also not sure it is meant for scanning (btw there are discussions about TRUNCATE these days so I mightbe missing something).<br />So, what you are looking for can be simply solved with row-level triggers on DELETE, sowhy not using that and avoid reinventing the wheel?<br />-- <br />Michael Paquier<br /><a href="http://michael.otacoo.com"target="_blank">http://michael.otacoo.com</a><br />
В списке pgsql-hackers по дате отправления: