Re: DEALLOCATE IF EXISTS

From: Vik Reykja <vikreykja(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(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>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)fr>
Subject: Re: DEALLOCATE IF EXISTS
Date: 2012-11-30 10:05:04
Message-ID: CALDgxVsHxo5+iNwiM9hwi57h71wSgOkRfQE_613Mfx8bm46a+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 27, 2012 at 3:15 PM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com
> wrote:

> 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.
>

Hmm. The test case I had for it, which was very annoying in an "I want to
be lazy" sort of way, I am unable to reproduce now. So I guess this
becomes a "make it like the others" and the community can decide whether
that's desirable.

In my personal case, which again I can't reproduce because it's been a
while since I've done it, DEALLOCATE ALL would have worked. I was
basically preparing a query to work on it in the same conditions that it
would be executed in a function, and I was only working on one of these at
a time so ALL would have been fine.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2012-11-30 10:09:29 Re: Review: Extra Daemons / bgworker
Previous Message Boszormenyi Zoltan 2012-11-30 09:13:27 Re: [PATCH] Make pg_basebackup configure and start standby [Review]