pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Corey Huinker <corey.huinker@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: Variable substitution in psql backtick expansion
Date: Sun, 02 Apr 2017 19:55:11 -0400
Message-ID: <23763.1491177311@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.DEB.2.20.1704022144470.9265@lancre>
References: <bc15034d-b421-42ac-89b1-c3485fa1728b@manitou-mail.org>
	<alpine.DEB.2.20.1704020841490.4632@lancre>
	<CAFj8pRDCfLLNfMyNAjDwgHXS7inThdqgCaSbfKpiYXkb6Mvmwg@mail.gmail.com>
	<alpine.DEB.2.20.1704020917220.4632@lancre>
	<CAFj8pRCVFp+68Tt29sZfn9tE28c2D7u_VzTcXrqjyCVBzAzRsA@mail.gmail.com>
	<alpine.DEB.2.20.1704021303300.4632@lancre>
	<CAFj8pRACH1M=egydH4dAAoo9rRVTkuYCaoyZQK2Yf4BTQuRM5w@mail.gmail.com>
	<CADkLM=dzsbgJdP7KAJnbihxU1XFnWZgit9ye5cWnvkjZXyPbGw@mail.gmail.com>
	<alpine.DEB.2.20.1704021805550.4632@lancre>
	<CADkLM=c+hm2rc0tkKgC-ZgrLttHT2KkfppE+BC-=i-xj+7V-TQ@mail.gmail.com>
	<alpine.DEB.2.20.1704022144470.9265@lancre>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Fabien COELHO <coelho@cri.ensmp.fr> writes:
>>> - how desirable/useful is it to have this in 10?

>> Extensions and extension-ish packages will love the _NUM vars.

> Hmmmm. I'm afraid pg extension scripts (for CREATE EXTENSION) are not 
> executed through psql, but server side directly, so there is not much 
> backslash-command support.

Yeah.

>> There's a lesser need for the _NAME vars.

> I put them more for error reporting, eg:

>    \if :VERSION_NUM < 110000
>      \echo :VERSION_NAME is not supported, should be at least 11.0
>      \q
>    \endif

I kinda feel like we're getting ahead of ourselves here, in that
the above is not going to do what you want until we have some kind
of expression eval capability built into psql.  You pointed out that
"\if false" can be used to reject pre-v10 psqls, but what about
rejecting v10?  ISTM that if we leave this out until there's something
that can do something useful with it, then something along the lines of

\if false
  -- pre-v10, complain and die
\endif
\if not defined VERSION_NUM
  -- pre-v11, complain and die
\endif

would do the trick.  Of course, there are probably other ways to
do that, but my point is that you haven't made a case why we need
to put this in now rather than later.

			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 (96+ messages)  latest in thread

Message-ID: <23763.1491177311@sss.pgh.pa.us>
Permalink:  ../23763.1491177311@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23763.1491177311@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, coelho@cri.ensmp.fr, corey.huinker@gmail.com, pavel.stehule@gmail.com, daniel@manitou-mail.org
  Subject: Re: Variable substitution in psql backtick expansion
  In-Reply-To: <23763.1491177311@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