Re: DEALLOCATE IF EXISTS - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: DEALLOCATE IF EXISTS
Date
Msg-id 50B4CAEA.1030403@vmware.com
Whole thread Raw
In response to Re: DEALLOCATE IF EXISTS  (Vik Reykja <vikreykja@gmail.com>)
Responses Re: DEALLOCATE IF EXISTS
List 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:
>
>> Sébastien Lardière<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



pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: review: Deparsing DDL command strings
Next
From: David Johnston
Date:
Subject: Re: Materialized views WIP patch