Re: \gexec \watch

From: Oleksii Kliukin <alexk(at)hintbits(dot)com>
To: Álvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: \gexec \watch
Date: 2018-12-06 14:01:35
Message-ID: 727325C1-FB57-4C78-A9E6-17F44EBB7184@hintbits.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi Álvaro,

> On 6. Dec 2018, at 13:56, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> To Oleksii's question, I think if you want to repeat the first query
> over and over, you'd use something like this:
>
> select format('select now() as execution_time, %L as generation_time', now()) as query \gset
> :query \watch

Nice one, although it only works if the original query outputs a single row (because of \gset).
I do agree it’s not that useful to reuse the original query instead of executing it anew each time.

Cheers,
Oleksii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-12-06 14:41:56 Mutability of domain CHECK constraints
Previous Message Daniel Verite 2018-12-06 13:48:40 Re: \gexec \watch