Re: Variable substitution in psql backtick expansion

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Variable substitution in psql backtick expansion
Date: 2017-09-06 16:42:58
Message-ID: alpine.DEB.2.20.1709061837520.17848@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> Seeing it as is, it calls for having "SERVER_VERSION" as well, but I'm not
>> sure of the better way to get it. I tried with "SELECT VERSION() AS
>> SERVER_VERSION \gset" but varnames are lowerized.
>
> The problem there is you can't get version() without an extra round trip
> to the server --- and an extra logged query --- which people are going to
> complain about.

Here is a PoC that does it through a guc, just like "server_version" (the
short version) is transmitted, with a fallback if it is not there.

Whether it is worth it is debatable, but I like the symmetry of having
the same informations accessible the same way for client and server sides.

--
Fabien.

Attachment Content-Type Size
psql-server-version-1.patch text/x-diff 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-09-06 16:43:42 Re: Patch: Add --no-comments to skip COMMENTs with pg_dump
Previous Message Simon Riggs 2017-09-06 16:26:21 Re: Patch: Add --no-comments to skip COMMENTs with pg_dump