Re: \gexec \watch - Mailing list pgsql-hackers

From Oleksii Kliukin
Subject Re: \gexec \watch
Date
Msg-id 727325C1-FB57-4C78-A9E6-17F44EBB7184@hintbits.com
Whole thread Raw
In response to Re: \gexec \watch  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi Álvaro,

> On 6. Dec 2018, at 13:56, Alvaro Herrera <alvherre@2ndquadrant.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

pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: \gexec \watch
Next
From: Tom Lane
Date:
Subject: Mutability of domain CHECK constraints