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 1jjxxd-00066f-J0 for pgsql-general@arkaria.postgresql.org; Sat, 13 Jun 2020 04:40:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jjxxc-0008HZ-Go for pgsql-general@arkaria.postgresql.org; Sat, 13 Jun 2020 04:40:04 +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 1jjxxc-0008HS-6u for pgsql-general@lists.postgresql.org; Sat, 13 Jun 2020 04:40:04 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jjxxZ-00060o-K1 for pgsql-general@postgresql.org; Sat, 13 Jun 2020 04:40:03 +0000 Received: by mail-ot1-x341.google.com with SMTP id g7so9008802oti.13 for ; Fri, 12 Jun 2020 21:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=q5sCLzLhlMV047IQrcMnW1mcImeI7ducnlpP80xfsm8=; b=Dqh9Je3T+kYPFL4lCR6Pp1RNwYeGn4puFbwUEdRNh+Xcp0X1LW4mGdyg5r3oFdox64 filB9w2GEFHlxS+DCOisG7X6/BHsuDWZHmrQw4StPCMwCjSPf4i9hAHjvMOJJoESI5Kn aApIb5wUCydWEr77XitaowktjR5N29zFHwXFD4U/UQ3Jf3IomAq6pC7AFPgtEf7lD2T/ gp0VCwyVoqmjYtJXbZ6xrtfXVYMrkCNEYL3Ma/09eEXVIYCNWC7QmVD53Wvd4Ap38GMQ xnE/yB3nfv2UR5NkJtrZ4d67t838SJBkyX5TKyKpZ/U4+wsje0E+FCP15ZdPMgXvQx7e cfXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=q5sCLzLhlMV047IQrcMnW1mcImeI7ducnlpP80xfsm8=; b=WmCePWGW6Mh7IWI2Rbw+dsNhnF2qkT9n5/VImhTA3dSpoar2WnrKaTmR0SLPDfjhRI N+FG8gwwOBrwVsFcodSWw+YbAL88NrlOStfzw6AZVnRgw/KRHqimdsrg6ixSTJR8Kjxr h7n49d6OEf880owNjl+vevYnrDFHRntc80Kb9m2XnYjkwJorpezwUkmGBzEilsdVCChX q9qfEg7Q0SYQQybwkJeS17hnGn6YdHC791h5FRSTqxakstP+3F3/aHb1DofxpNpJOGN8 vQBTkOTxRnJrO3Wtpq7WKziXKVOT/7ntfTtYNYqev2Hc1CzKfk0SdjZ/e7BfHqEpG+zq GMLA== X-Gm-Message-State: AOAM532BTY7K3sv7KZDj5O37Ck8jzYNYKIDkvmETB0Y0kQQB9lzhW/1s 1i+b8CeTMhMlOsCqhoxw4Nt+LnyRwSan2Q== X-Google-Smtp-Source: ABdhPJyQFZtVln6BDrsfnM5vQ0+SA4cI5We1R67XW2LEQGV1y0UOQ7yLcdw7kyG5MXVYhN4frFwdKw== X-Received: by 2002:a9d:32b6:: with SMTP id u51mr12576163otb.121.1592023200398; Fri, 12 Jun 2020 21:40:00 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id a12sm1817116otl.29.2020.06.12.21.39.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jun 2020 21:39:59 -0700 (PDT) To: "pgsql-general@postgresql.org >> PG-General Mailing List" From: Ron Subject: Returning SELECTed rows immediately instead of all at the end? Message-ID: Date: Fri, 12 Jun 2020 23:39:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I'm running amcheck on a set of indices (test machine, not prod) and want to track the progress.  Is there a SELECT clause that makes rows display as they are created, or do I have to explicitly call bt_index_check() from a shell script or SQL function in order to see the output as each index is checked? postgres=# select version();                     version ------------------------------------------------------ PostgreSQL 9.6.18 on [snip] (Red Hat 4.4.7-23), 64-bit (1 row) postgres=# \dx                            List of installed extensions      Name     | Version |   Schema   | Description --------------+---------+------------+-------------------------------------------- amcheck_next | 2       | public     | functions for verifying relation integrity plpgsql      | 1.0     | pg_catalog | PL/pgSQL procedural language #!/bin/bash echo `date +"%F %T, %a"` Starting psql CDSLBXW -c \ "SELECT clock_timestamp(),         bt_index_check(c.oid, i.indisunique),         n.nspname,         c.relname ,         c.relpages FROM pg_index i        JOIN pg_opclass op ON i.indclass[0] = op.oid        JOIN pg_am am ON op.opcmethod = am.oid        JOIN pg_class c ON i.indexrelid = c.oid        JOIN pg_namespace n ON c.relnamespace = n.oid WHERE am.amname = 'btree'   AND c.relpersistence != 't'   AND c.relkind = 'i'   AND i.indisready   AND i.indisvalid ORDER BY c.relpages desc ;" echo `date +"%F %T, %a"` Finished -- Angular momentum makes the world go 'round.