pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Corey Huinker <corey.huinker@gmail.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Greg Stark <stark@mit.edu>
Cc: Erik Rijkers <er@xs4all.nl>
Cc: Robert Haas <robertmhaas@gmail.com>
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: Fri, 17 Mar 2017 13:27:49 -0400
Message-ID: <15541.1489771669@sss.pgh.pa.us> (raw )
In-Reply-To: <CADkLM=d40LRKHsJskMVVOm=0wZd2HLOo40hakjXRPYjSSjdZ=Q@mail.gmail.com >
References: <df2c433c-b9ff-4d41-ad08-b0d420b403b8@manitou-mail.org >
<15875.1489440118@sss.pgh.pa.us >
<CADkLM=fzjNr2it+a75CJgs7nPPSb-S=q=taa7=7mtxa5pKJSbQ@mail.gmail.com >
<24741.1489698878@sss.pgh.pa.us >
<CADkLM=fHrBW4Z+ixPD35Ad+4oKG1KX0UK7xDY+0G9gdNnDQS8A@mail.gmail.com >
<alpine.DEB.2.20.1703170710320.4278@lancre >
<30537.1489761433@sss.pgh.pa.us >
<alpine.DEB.2.20.1703171553550.21944@lancre >
<11743.1489765330@sss.pgh.pa.us >
<CADkLM=f3n9FR+fV+Lt+aVOinTZwC1BiBbYTOKYLt+Gv4OCL5jw@mail.gmail.com >
<13603.1489768437@sss.pgh.pa.us >
<CADkLM=d40LRKHsJskMVVOm=0wZd2HLOo40hakjXRPYjSSjdZ=Q@mail.gmail.com >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Corey Huinker <corey.huinker@gmail.com> writes:
>> In the end, I suspect that teaching all the backslash commands to do
>> nothing after absorbing their arguments is likely to be the least messy
>> way to tackle this, even if it makes for a rather bulky patch.
> Perhaps, but just glancing at \connect makes me think that for some
> commands (present or future) the number of args might depend on the value
> of the first arg, and variable expansion-or-not, backtick execution-or-not
> could alter the number of apparent args on the line, like this:
> \set x 'arg1 arg2'
> \if false
> \cmd_that_takes_exactly_two_args :x
> \endif
Yeah, throwing errors for bad arguments would also need to be suppressed.
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: <15541.1489771669@sss.pgh.pa.us>
Permalink: ../15541.1489771669@sss.pgh.pa.us/
Also on: postgresql.org/message-id/15541.1489771669@sss.pgh.pa.us
copy link · copy postgr.es
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, corey.huinker@gmail.com, coelho@cri.ensmp.fr, daniel@manitou-mail.org, david.g.johnston@gmail.com, stark@mit.edu, er@xs4all.nl, robertmhaas@gmail.com, 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: <15541.1489771669@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