also sprach Debian Bug Tracking System <[EMAIL PROTECTED]> [2008.11.16.1548 
+0100]:
> martin f krafft [2007-08-28 19:10 +0200]:
> > It would be really nice if psql prompted me whether I wanted to do
> > this. As it stands, it just rolls back the transaction.
> 
> This was discussed upstream a while ago. An interactive question was
> deemed both too annoying, as well as potentially breaking scripts.

Thanks, Martin, for your efforts. I find the reasoning by upstream
pretty unaccceptable.

First of all, an interactive question could per definition never
break a script, since it would never get asked non-interactively.

Second, I can hardly imagine a script doing \q.

Third, arguing that a prompt in response to an attempt to quit
*while a transaction was open* would be "too annoying" would mean
that any application asking me to save changes before quitting is
also too annoying. I think they would find it too annoying to
implement, because I cannot believe that there are more users out
there who'd be annoyed by a safety net question like this than users
who'd be annoyed losing data.

Fourth, there is the option of making this configurable, i.e. only
asking for confirmation when a transaction is in progress and an
option has been set. That option could be
confirm_quit=yes/no/transaction-only.

> Thus a notification needs to be enough.
> This can be achieved with using the %x escape sequence for the
> PROMPT[1-3] psql variables.

Sure, but it won't actually prevent me from accidentally losing
a transaction by mistake.

-- 
 .''`.   martin f. krafft <[EMAIL PROTECTED]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

Reply via email to