Re: thoughts on interactive query - Mailing list pgsql-general

From Merlin Moncure
Subject Re: thoughts on interactive query
Date
Msg-id BANLkTikuksDF2LA2v4X1cfpK5nBRwGysjQ@mail.gmail.com
Whole thread Raw
In response to thoughts on interactive query  (Sim Zacks <sim@compulab.co.il>)
List pgsql-general
On Tue, Jun 14, 2011 at 2:39 AM, Sim Zacks <sim@compulab.co.il> wrote:
> I am playing around with making interactive queries and was wondering if
> anyone had any comments.
>
> If your comment is "That is a stupid idea", please try to qualify that with
> something constructive as well.
>
>
> The idea is that sometimes during a process, user input is required. The way
> we have been doing this is to  return an error code and then the GUI asks
> the user the question and restarts the query with the answer passed as a
> parameter.
>
>
> The problem with this is that it is sometimes a long, complicated
> transaction and ending it in the middle just to ask the user "yes or no" and
> then running the entire transaction again seems awfully inefficient.

It's widely considered bad mojo to bock a transaction while waiting on
input.  I completely agree with this, and all else aside I think that
even if your idea could be made to work it encourages bad behaviors.
Gather all your answers before running your query (and if that can't
be done, your question is too complicated).

merlin

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: duplicate key violate error
Next
From: Tom Lane
Date:
Subject: Re: psql reports back wrong number of affected rows.