Skip site navigation (1) Skip section navigation (2)

Re: executing a dml within a utility

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Ehab Galal <ehabgalal123(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: executing a dml within a utility
Date: 2006-12-21 21:13:32
Message-ID: 20061221211332.GP5199@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
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.

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2006-12-21 22:11:54
Subject: Re: Release 8.2.0 done, 8.3 development starts
Previous:From: Ehab GalalDate: 2006-12-21 20:47:39
Subject: executing a dml within a utility

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group