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 1pVG8b-0000sU-JV for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Feb 2023 18:16:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVG8a-00037W-Eo for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Feb 2023 18:16:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVG8a-00037M-3H for pgsql-hackers@lists.postgresql.org; Thu, 23 Feb 2023 18:16:12 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pVG8Y-0004O3-1Q for pgsql-hackers@lists.postgresql.org; Thu, 23 Feb 2023 18:16:11 +0000 Received: by mail-pf1-x430.google.com with SMTP id a7so6524763pfx.10 for ; Thu, 23 Feb 2023 10:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NIo7N53pqBscuNN9zRybvc8F/ubFuVfZUp6gbiPgtSA=; b=PMrPwlAqrSZGWDVIgYNLQUSk1XRkMOQBxX+ZMqPSYTbGNNiD/T64NI1MO7tK4YeTnY 9Yz1jUHDcrWYn1hq3y9WXF42oOw3Fd2kKDx5wTozT12QR1m20oNvfVr3WU2cS+y7b7Yu SoaOpie271wOBMKexdejRcig2KFh4+d+uKqs23FyfkQzwegRpCN2/KkaUiYwM//5dGr/ wzzQMVCAgyxsIivhdR0uoz8ISwoaZLcNehv571H8zY9xYvSLkogy6ZLQnDklGJLkKYdD 8ZX3gXdNu4Nu4M8hwibSIBix/kSeABTWCoUcHtIvSAh4K72d429xEQJS2vMwg+MeN07g 1dfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NIo7N53pqBscuNN9zRybvc8F/ubFuVfZUp6gbiPgtSA=; b=LE0XAPR4a/PcmJsrPyBP9RSSlUCYTOODaVlKKN45MmvXruLd1LGkty565fN7ylxI6M 5Tum7fWGvKMQmxYHMe8BWwsGjKU1zLJDyu8CqjCuFEDkxREzVTR/6E9w8mFURoYvA+p8 HKCxtW3oZXcR9BZYbN392qUd/sRRRb8ef8grfxR6RHaPw6uyEbwsHVMR3T0jfHCeiCBl 4UphTR2duTH3zOjzp5ENT5GUBMW3eS84ZL6WORWs1XLavjoMCUn6ZdQXvYh1UHcuvR+W ZZAv2jg6QrlCq7vABXLpjVRQHUHJjoHQp7WzGrHZuZbHPUANjml4kyLfu/jvpJXuZnlF 2BTg== X-Gm-Message-State: AO0yUKXqnt0L5ec/Kqg+IZLovhbjfzgH12oo7rSsPeQsn1KU5Oc1JE0l KqMc1hZ8RzKwvH4durb31/rF2Y5DT1tgq+evQps= X-Google-Smtp-Source: AK7set+8NRhrdiQ5U+7gmOjVsYxf7GuXUcB91N7elNDXjO+eNph+Sf7I1HHXsXSgJ3fFPgZYW4XxC3IOiE30GvhksHc= X-Received: by 2002:a63:77c8:0:b0:4fb:8801:8f72 with SMTP id s191-20020a6377c8000000b004fb88018f72mr1899075pgc.4.1677176167420; Thu, 23 Feb 2023 10:16:07 -0800 (PST) MIME-Version: 1.0 References: <157609.1677088525@sss.pgh.pa.us> <2f1c8cb9-6f4d-2a03-d069-c4f9c2b574ab@enterprisedb.com> <414445.1677163935@sss.pgh.pa.us> In-Reply-To: From: Maciek Sakrejda Date: Thu, 23 Feb 2023 10:15:54 -0800 Message-ID: Subject: Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has) To: Nikolay Samokhvalov Cc: Tom Lane , Heikki Linnakangas , Peter Eisentraut , Kirk Wolak , PostgreSQL Hackers , Pavel Stehule , Andrey Borodin , Laurenz Albe Content-Type: multipart/alternative; boundary="000000000000af57b405f562015d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000af57b405f562015d Content-Type: text/plain; charset="UTF-8" On Thu, Feb 23, 2023, 09:55 Nikolay Samokhvalov wrote: > On Thu, Feb 23, 2023 at 9:05 AM Maciek Sakrejda > wrote: > >> I think Heikki's solution is probably more practical since (1) .. > > > Note that these ideas target two *different* problems: > - what was the duration of the last query > - when was the last query executed > > So, having both solved would be ideal. > Fair point, but since the duration solution needs to capture two timestamps anyway, it could print start time as well as duration. The prompt timestamp could still be handy for more intricate session forensics, but I don't know if that's a common-enough use case. Thanks, Maciek > --000000000000af57b405f562015d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Feb 23, 2023, 09:55 Nikolay Samokhvalov <samokhvalov@gmail.com> wrote:
On Thu, = Feb 23, 2023 at 9:05 AM Maciek Sakrejda <m.sakrejda@gmail.com> = wrote:
I think Heikki's solution is probably more practical since (1) ..

Note that these ideas target two *different* pro= blems:
- what was the duration of the last query
- when= was the last query executed

So, having both solve= d would be ideal.

Fair point, but since the duration solution = needs to capture two timestamps anyway, it could print start time as well a= s duration.

The prompt t= imestamp could still be handy for more intricate session forensics, but I d= on't know if that's a common-enough use case.

Thanks,
Maciek
--000000000000af57b405f562015d--