Tag Info

New answers tagged


This is perfectly possible with triggers, and if you must ensure integrity at an application-independent level, this is possibly your best shot. From this example you can see that recursion is possible in POSTGRESQL stored procedures, so traversing the tree should not be too hard to be implemented. Of course, you may have to implement "AFTER INSERT", "AFTER ...


If the database is under control of the application (not modified by anything else), do it at the application level, not the database level. In theory you could do it with triggers, but I don't think you should. Checking the validity of such a structure requires computationally complex queries, and there is significant danger that this will have a ...

Top 50 recent answers are included