Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojmuQ-0000xT-5j for pgsql-sql@arkaria.postgresql.org; Sat, 15 Oct 2022 19:33:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ojmuN-00071v-Du for pgsql-sql@arkaria.postgresql.org; Sat, 15 Oct 2022 19:33:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojmuN-00071j-3r for pgsql-sql@lists.postgresql.org; Sat, 15 Oct 2022 19:33:19 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ojmuH-00068w-Cg for pgsql-sql@lists.postgresql.org; Sat, 15 Oct 2022 19:33:18 +0000 Received: by mail-ej1-x62e.google.com with SMTP id b2so17022442eja.6 for ; Sat, 15 Oct 2022 12:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=vQEuVEdV2/Yjjf2aUmwSBBnvmu4d8nACbleW0N6vk3c=; b=QDtbWx2alkPEowZf0aN1t2eGqovSEIpB+MIpTrxWxyAAwp2ezEzSJPz8DKw9EvKp9M P6nmeYmNfd2b6pOB4B4EWaZ0tXQ4OXG4iKlKTJrp4j0FtARRpFUTJrQWrbbagfoba6go s3OcJUDWEkWuItBbqATG1lUwL+SDR0vrPVQsoxdwJmjvdpv7d9wc1ph2rVQGFT3Eecqc XXw+ioyb7jlFXmyHwklxwhV6jBiOC9a0Zu+KdLDWBhKIN7wo7A7mGwnMVVq3sjAerxAS lMTcpU2vXB35Vzx+cfh434tm0R8+ca4mLTi0yRLU01kp8vzEQ2r3PIrYdEOaWNEIy48Z JVXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vQEuVEdV2/Yjjf2aUmwSBBnvmu4d8nACbleW0N6vk3c=; b=vOFONlRah7X+eIQFRq1+fmVblCGiqvpbP/bfuGbOPp/0jPbRISTAMcbA85lL0DCk0V MVXtcLi6ApwWq3Rb4GftCx1nDJSifHf+ARc3x96SrTIsfOrFXn91kRAyPOvgbqVUSiay ihPEORiswXxGICrZzQ5YUAccoyBR5wa0XLzkceSoQ1+XmxC+1aoAnGXoRmOa/ovO50Y9 yNvtkfr+UqQE5mVbuWAAzqMvWZL3c899enHfnVZge36Eko6lRDaghRHbU+tciwL44IMe j6vdg1QuSpsCT1CgPsdQH9IafnA1OKlOdVNtLMQ+SRQzgVfxT+UkKJI60h2UCw/Mu/+j P3DQ== X-Gm-Message-State: ACrzQf3kFdPOyLknhWG8+BkjRan1cSWVe5XmavAPu8vpTUx/BTRsg1Ix pWwhkdhvqnzUV1MSarQNe4WG3qgMezt6kgftvc7g9M2Gyfs= X-Google-Smtp-Source: AMsMyM7m10L3lKpWvpOP53wMuH70hWi0XgnWB5a9IKchRfOdd0iyup3Q2Tm8K+A5KNdUgD5ET/xayVo8uPV493Boxro= X-Received: by 2002:a17:907:3e03:b0:722:e694:438 with SMTP id hp3-20020a1709073e0300b00722e6940438mr3053794ejc.755.1665862391313; Sat, 15 Oct 2022 12:33:11 -0700 (PDT) MIME-Version: 1.0 From: Shaozhong SHI Date: Sat, 15 Oct 2022 20:32:59 +0100 Message-ID: Subject: How to do things like \timing on in a do loop? To: pgsql-sql Content-Type: multipart/alternative; boundary="000000000000143aae05eb17d057" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000143aae05eb17d057 Content-Type: text/plain; charset="UTF-8" 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 --000000000000143aae05eb17d057 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
DO
$do$
declare<= /div>

j int=3D1;

BEGIN=C2=A0

for j in 1..100 loop

\timin= g on

select * from a_table;

end loop;

end
$$;


It appears that \timing on is not allowed in a do stat= ement.

Any alternative to do that in a do statemen= t?

Regards,

David
--000000000000143aae05eb17d057--