pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: Erik Rijkers <er@xs4all.nl>
Cc: Jim Nasby <Jim.Nasby@bluetreble.com>
Cc: PostgreSQL <pgsql-hackers@postgresql.org>
Cc: pgsql-hackers-owner@postgresql.org
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Date: Thu, 09 Feb 2017 15:13:04 -0500
Message-ID: <24063.1486671184@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoYn+cVfS=DiL6usdDHurV8UKCJQrShCbs5o+9dXEVTqvg@mail.gmail.com>
References: <CADkLM=dcMHeSOQZv0Dd8AO4cM+OzADg7u8PcA7d8pNezmLDo=g@mail.gmail.com>
	<ac097a44-f9f4-4e80-ba6b-996f0e42c8d8@manitou-mail.org>
	<CADkLM=dZ=u5+iTMQY=CnEkAjmwh2f2+Pv_==V5tELcR0P7qxJw@mail.gmail.com>
	<CADkLM=cxEPJW+67cnam_on_fH3eQaekTS-8=Aa-JM+4ETr71Kw@mail.gmail.com>
	<alpine.DEB.2.20.1702050813050.21110@lancre>
	<CADkLM=d1pmBN5x+X4Hm46UHOXHSdTCVpToC6ZPEAFM7T8UYEnw@mail.gmail.com>
	<alpine.DEB.2.20.1702061014150.10745@lancre>
	<alpine.DEB.2.20.1702061038090.10745@lancre>
	<CADkLM=cB6yCZiqXam6TkT+9UDrsmyrievdOUcOWRqMiEvt3HPw@mail.gmail.com>
	<alpine.DEB.2.20.1702062030240.8133@lancre>
	<CADkLM=fYJ=1rQbj=dCoMrFkVs=+6=cfmNSD8RRSL8-UxF40-Ew@mail.gmail.com>
	<alpine.DEB.2.20.1702062104291.8133@lancre>
	<CADkLM=cnCg+rxWfL9H-zL30QusB7vr0meykhwgJAtren21rxYA@mail.gmail.com>
	<CADkLM=eVD+SXB0LD6J1pn+NiWn4sLqR7RUpMpd8FPnvyToyWjw@mail.gmail.com>
	<CA+TgmoYn+cVfS=DiL6usdDHurV8UKCJQrShCbs5o+9dXEVTqvg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas <robertmhaas@gmail.com> writes:
> I (still) think this is a bad design.  Even if you've got all the
> messages just right as things stand today, some new feature that comes
> along in the future can change things so that they're not right any
> more, and nobody's going to relish maintaining this.

FWIW, I tend to agree that this is way overboard in terms of the amount of
complexity going into the messages.  Also, I do not like what seems to
be happening here:

>> $ psql test < test2.sql -v ON_ERROR_STOP=0
>> unrecognized value "error" for "\if <expr>": boolean expected
>> new \if is invalid, ignoring commands until next \endif

IMO, an erroneous backslash command should have no effect, period.
"It failed but we'll treat it as if it were valid" is a rathole
I don't want to descend into.  It's particularly bad in interactive
mode, because the most natural thing to do is correct your spelling
and issue the command again --- but if psql already decided to do
something on the strength of the mistaken command, that doesn't work,
and you'll have to do something or other to unwind the unwanted
control state before you can get back to what you meant to do.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (232+ messages)  latest in thread

Message-ID: <24063.1486671184@sss.pgh.pa.us>
Permalink:  ../24063.1486671184@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24063.1486671184@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, corey.huinker@gmail.com, coelho@cri.ensmp.fr, daniel@manitou-mail.org, er@xs4all.nl, Jim.Nasby@bluetreble.com, pgsql-hackers-owner@postgresql.org
  Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
  In-Reply-To: <24063.1486671184@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox