Re: Variable substitution in psql backtick expansion - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: Variable substitution in psql backtick expansion
Date
Msg-id 9c134d0f-65a7-4dc9-a54b-5b3ea9faf51e@manitou-mail.org
Whole thread Raw
In response to Variable substitution in psql backtick expansion  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Variable substitution in psql backtick expansion  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
    Fabien COELHO wrote:

> Now it could be decided that \set in psql stays simplistic because it is
> not needed as much as it is with pgbench. Fine with me.

It's not just that. It's that currently, if we do in psql:

\set d sqrt(1 + random(1000) * 17)

then we get that:

\echo :d
sqrt(1+random(1000)*17)

I assume we want to keep that pre-existing behavior of \set in
psql, that is, making a copy of that string and associating a
name to it, whereas I guess pgbench computes a value from it and
stores that value.

Certainly if we want the same sort of evaluator in pgbench and psql
we'd better share the code between them, but I don't think it will be
exposed by the same backslash commands in both programs,
if only for that backward compatibility concern.


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



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: SERIALIZABLE with parallel query
Next
From: Peter Eisentraut
Date:
Subject: Re: identity columns