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 1pVAPi-0004CO-LS for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Feb 2023 12:09:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVAPg-0001Dg-P2 for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Feb 2023 12:09:28 +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 1pVAPg-0001DW-BA for pgsql-hackers@lists.postgresql.org; Thu, 23 Feb 2023 12:09:28 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVAPd-0005u3-Gq for pgsql-hackers@lists.postgresql.org; Thu, 23 Feb 2023 12:09:27 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id C85AC1B001D8; Thu, 23 Feb 2023 14:09:19 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1677154160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=worvPncdF4soRQj3eBQwc4ZFtpnIjNUxZxYpxwW0WLY=; b=feHkMaLxtXqBfKwsapPB/q0O61fcQDPeTlr7NbgKUq9tY4TIPNXLpg0o4/TKv5XrKPFDxJ VX/ihCZPoGgjrWHa2gZDMFexE91PH+FF01oS8fV2qonkOGNVRojtud/o1NzHLN7MrfvfIW nWSzSEOXgy3GSPlX+3JXhO4sm7/+B7zgR0EJbCx1JCdWNDNCMqs1LbqcFIa3UnRqEKx74Y EyLf2yQaHO81UjuNfsge8k8DgfqAYjfWWczGOQAcgF2Djl4geY4jJXUztDrY9uXSgUMoxJ 31DWt/Py0yNvxcWcSoAuzrc2mwHAgJy1gM5GQA3hjW4IkdMDahBJhao73p8b1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1677154160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=worvPncdF4soRQj3eBQwc4ZFtpnIjNUxZxYpxwW0WLY=; b=SkDAGN6pXsNBdVVeaJjqbMbBTHM7lMQZaehonPJ3zMopKppGp9aYz24LN/QW5SJUVRtauJ GA9QKE278eODBVjOTyutd8HdopBhLS+cFOCotKe6L2SJZO86AIQmq6Rmag9JfxTYdJxspV by2s2f+XeMWZM7yl5obEwkKLyJCyBUr1FsCDyn0/qdnigEUVLesgO5iGXbTCKywt17lcGk Sy/6YRFCPgO9Pq6GMKzK9CRQ+Ws8owiJFEWN0v9nmZ8fA3E/6dn/+gZL/0G7Meq0+gsxRd z97asODlfiXH6D6KMubNWz+sXAPCCFTO7/vgI+jVq3ARJBcIvs/DlbW+k5P9xA== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1677154160; a=rsa-sha256; cv=none; b=lvcFNhIr+pt7mVxB7W6rz524G0UJcxOdWaI6Omdv89gItR/BNTiCEBcZnEA4ujvxIrjV9Q H/LV1j+VzF7Illi1b/ZnXK9wBLdqIS90BLulSoB+VSeDS0EUvveYQXiUpvWhQVmHMsg9Kv C2+59BIYuqktfpWtvUhl3PLgHbi5NVe9qzjC50J8ZDr9m8LlJGtmj3ccp4lZ2KhMzs6SWv py4c30TgTF27L3mXG174uImqdDigI2TDC/wqRDE+/hPkzGcSJiywJYw8pOXWtLqFpSpWia bwwJ2JVwAnk+PYAXDYVZCv6SQOL4h1vlsJu6RlzCDMjhQO0L9GahbcoLuNpVeQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Thu, 23 Feb 2023 14:09:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has) Content-Language: en-US To: Peter Eisentraut , Nikolay Samokhvalov , Tom Lane , Kirk Wolak Cc: PostgreSQL Hackers , Pavel Stehule , amborodin86@gmail.com, Laurenz Albe References: <157609.1677088525@sss.pgh.pa.us> <2f1c8cb9-6f4d-2a03-d069-c4f9c2b574ab@enterprisedb.com> From: Heikki Linnakangas In-Reply-To: <2f1c8cb9-6f4d-2a03-d069-c4f9c2b574ab@enterprisedb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 23/02/2023 13:20, Peter Eisentraut wrote: > On 22.02.23 19:14, Heikki Linnakangas wrote: >> How about a new backslash command or psql variable to show how long the >> previous statement took? Something like: > > If you don't have \timing turned on before the query starts, psql won't > record what the time was before the query, so you can't compute the run > time afterwards. This kind of feature would only work if you always > take the start time, even if \timing is turned off. Correct. That seems acceptable though? gettimeofday() can be slow on some platforms, but I doubt it's *that* slow, that we couldn't call it two times per query. - Heikki