This is a discussion on executing a dml within a utility within the pgsql Hackers forums, part of the PostgreSQL category; --> I created a CMD_UTILITY, which upon being executed by the user should do the following atomically: 1- drops a ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I created a CMD_UTILITY, which upon being executed by the user should do the following atomically: 1- drops a table 2- deletes from another table all rows with a certain criterion: "DELETE FROM pg_t1 WHERE att = val" 3- deletes from a third table all rows with a certain criterion: "DELETE FROM pg_t2 WHERE att = val" I do the first step using ProcessUtility(). How can i do the 2nd/3rd steps? Any suggestions? I tried calling exec_simple_query() but this didn't work. I am getting an error "cannot drop active portal" Thanks a lot, ehab __________________________________________________ _______________ Find sales, coupons, and free shipping, all in one place! *MSN Shopping Sales & Deals http://shopping.msn.com/content/shp/...tnrdata=200639 ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| ||||
| Ehab Galal wrote: > I created a CMD_UTILITY, which upon being executed by the user should do > the following atomically: > 1- drops a table > 2- deletes from another table all rows with a certain criterion: "DELETE > FROM pg_t1 WHERE att = val" > 3- deletes from a third table all rows with a certain criterion: "DELETE > FROM pg_t2 WHERE att = val" > > I do the first step using ProcessUtility(). How can i do the 2nd/3rd steps? > Any suggestions? Don't do that. Instead, use performDeletion and register your tuples in the pg_t1 and pg_t2 catalogs in pg_depend (using recordDependencyOn). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |