Re: DEALLOCATE IF EXISTS

Heikki Linnakangas <hlinnakangas@vmware.com>

From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Vik Reykja <vikreykja@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Sébastien Lardière <slardiere@hi-media.com>, Simon Riggs <simon@2ndquadrant.com>, pgsql-hackers@postgresql.org, cedric@2ndquadrant.fr
Date: 2012-11-27T14:15:06Z
Lists: pgsql-hackers
On 09.10.2012 17:44, Vik Reykja wrote:
> On Tue, Oct 9, 2012 at 4:09 PM, Tom Lane<tgl@sss.pgh.pa.us>  wrote:
>
>> =?ISO-8859-1?Q?S=E9bastien_Lardi=E8re?=<slardiere@hi-media.com>  writes:
>>> Indeed, brackets was not correct, it's better now (I think), and correct
>>> some comments.
>>
>> Still wrong ... at the very least you missed copyfuncs/equalfuncs.
>> In general, when adding a field to a struct, it's good practice to
>> grep for all uses of that struct.
>>
>
> I don't see Sébastien's message, but I made the same mistake in my patch.
> Another one is attached with copyfuncs and equalfuncs.  I did a grep for
> DeallocateStmt and I don't believe I have missed anything else.
>
> Also, I'm changing the subject so as not to hijack this thread any further.

I fail to see the point of DEALLOCATE IF EXISTS. Do you have real use 
case for this, or was this just a case of adding IF EXISTS to all 
commands for the sake of completeness?

Usually the client knows what statements have been prepared, but perhaps 
you want to make sure everything is deallocated in some error handling 
case or similar. But in that case, you might as well just issue a 
regular DEALLOCATE and ignore errors. Or even more likely, you'll want 
to use DEALLOCATE ALL.

- Heikki

-- 
- Heikki