Re: NOT EXIST for PREPARE - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: NOT EXIST for PREPARE
Date
Msg-id CAMsr+YHZ2xxoLqK5awhU+NFnkrA4wZjTehE0+-KjUyOH0qY3ww@mail.gmail.com
Whole thread Raw
In response to Re: NOT EXIST for PREPARE  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On 24 March 2016 at 02:01, Merlin Moncure <mmoncure@gmail.com> wrote:
 
> If you plan to have "prepare if not exists" at startup only, why don't
> you just wrap it with
> exception handler then?

That's impolite to our users.  Virtually all other commands have been
decorated with IF [NOT] exists to avoid having to guard with exception
handler -- why not this one?  Also, if the handler is on the client
side, it tends to be racey.

Yeah. Also, the log spam from that is ugly and it's really best avoided.

I find that to be a very frustrating issue with client-side upsert retry loop approaches. Less of a concern now that 9.5 has a true upsert, but that's not the only area where the client is expected to try it and handle the error if it fails.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: README for src/backend/replication/logical
Next
From: Andres Freund
Date:
Subject: Re: Speed up Clog Access by increasing CLOG buffers