How to do things like \timing on in a do loop? - Mailing list pgsql-sql

From Shaozhong SHI
Subject How to do things like \timing on in a do loop?
Date
Msg-id CA+i5JwbMGFD_Yu93oHgqvq3zmftRp4OsLjkyRUKob4oQDkDe_w@mail.gmail.com
Whole thread Raw
Responses Re: How to do things like \timing on in a do loop?  (Erik Brandsberg <erik@heimdalldata.com>)
Re: How to do things like \timing on in a do loop?  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-sql
DO
$do$
declare

j int=1;

BEGIN 

for j in 1..100 loop

\timing on

select * from a_table;

end loop;

end
$$;


It appears that \timing on is not allowed in a do statement.

Any alternative to do that in a do statement?

Regards,

David

pgsql-sql by date:

Previous
From: Frank Gard
Date:
Subject: Re: Append a list of tables to an empty table to form a whole table
Next
From: Erik Brandsberg
Date:
Subject: Re: How to do things like \timing on in a do loop?