Re: DEALLOCATE IF EXISTS

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Vik Reykja <vikreykja(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Sébastien Lardière <slardiere(at)hi-media(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, cedric(at)2ndquadrant(dot)fr
Subject: Re: DEALLOCATE IF EXISTS
Date: 2012-11-27 14:15:06
Message-ID: 50B4CAEA.1030403@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09.10.2012 17:44, Vik Reykja wrote:
> On Tue, Oct 9, 2012 at 4:09 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> =?ISO-8859-1?Q?S=E9bastien_Lardi=E8re?=<slardiere(at)hi-media(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Johnston 2012-11-27 14:17:14 Re: Materialized views WIP patch
Previous Message Dimitri Fontaine 2012-11-27 14:10:30 Re: review: Deparsing DDL command strings