Re: Improvements in psql hooks for variables

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Ashutosh Sharma" <ashu(dot)coek88(at)gmail(dot)com>,"Rahila Syed" <rahilasyed90(at)gmail(dot)com>,"Stephen Frost" <sfrost(at)snowman(dot)net>,"Ashutosh Bapat" <ashutosh(dot)bapat(at)enterprisedb(dot)com>,"pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improvements in psql hooks for variables
Date: 2017-01-24 16:54:09
Message-ID: a14ff475-c4b3-49fb-90c5-73b7554ab04b@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> However, it only really works if psql never overwrites the values
> after startup, whereas I believe all of these are overwritten by
> a \c command.

Yes, there are reset to reflect the properties of the new connection.

> So maybe it's more user-friendly to make these variables fully
> reserved, even at the risk of breaking existing scripts. But
> I don't think it's exactly an open-and-shut question.

You mean if we make that fail: \set ENCODING UTF8
it's going to make that fail too:
SELECT something AS "ENCODING"[,...] \gset
and I agree it's not obvious that this trade-off has to be
made. Personally I'm fine with the status quo and will
not add that hook into the patch unless pressed to.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mithun Cy 2017-01-24 16:55:24 Re: Proposal : For Auto-Prewarm.
Previous Message Erik Rijkers 2017-01-24 16:37:12 Re: logical-replication.sgml improvements