How to do things like \timing on in a do loop?

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: How to do things like \timing on in a do loop?
Date: 2022-10-15 19:32:59
Message-ID: CA+i5JwbMGFD_Yu93oHgqvq3zmftRp4OsLjkyRUKob4oQDkDe_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Erik Brandsberg 2022-10-15 20:04:41 Re: How to do things like \timing on in a do loop?
Previous Message Frank Gard 2022-10-14 08:50:06 Re: Append a list of tables to an empty table to form a whole table