Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ub3yp-00DHhj-So for pgsql-docs@arkaria.postgresql.org; Sun, 13 Jul 2025 21:11:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ub3yn-0011on-KN for pgsql-docs@arkaria.postgresql.org; Sun, 13 Jul 2025 21:11:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ub3yn-0011of-BT for pgsql-docs@lists.postgresql.org; Sun, 13 Jul 2025 21:11:26 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ub3yl-0077ql-21 for pgsql-docs@lists.postgresql.org; Sun, 13 Jul 2025 21:11:24 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4537edf2c3cso38836195e9.3 for ; Sun, 13 Jul 2025 14:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752441080; x=1753045880; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=8Sp8gGY8B2HlPXEzbJWG61QdZA6NrgsXeNNQBM1xO+w=; b=pWRBTe+WqFduRmiGajO8Mb67B/hhMBGE9XDf1DnVEcvq4k2n+/W+FXbENvN+6tGai6 cw/xBp89f9JK3tyDUtLSxu1urQnqgTXKMRVgT31JRjD0zHxFTLbZQ9+93MVJ7FkwStNg Z5g9cvB8UvF97kUdkwjncwo/14ZejIM5IAwHGsVCPUSujOw+INzKkLXZXFGkuCn/GT+H BU2sdJOQCz43L9z5uQ2/Go4f0CVlQjBOP5C1zQNsH7KNQFlzQts3QQjGg288ucITO0RL MFYxkATswYGJHy4x2unt986j9/1kPSUIxdStWb8bhTOFisipM2pVGVq+pvEP31D55h6U KqRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752441080; x=1753045880; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8Sp8gGY8B2HlPXEzbJWG61QdZA6NrgsXeNNQBM1xO+w=; b=CoUIDyWJmR+dV7leYAlP1MiMdj4az3F4fA4fMA5t3eOxVl2C0wRBROMO+wHkVA8J19 /A+SvjOWbsKpxiJOPAhK6gsDVDQ9aWLrwYbEPj5eZR7t/SGsYXPmGikGt0cjQqSZ0oUC 1gR44Yu8HPGmVLYdh98uaES/RVtsJHPxWgv8aSh7M2TsNdGQYIPKO/UBG5gUcTDxYbR7 4xPxnMfmaVKo2e740MutLCfaupTe09B/hXd4p/aEruSC9sFAUu0dR0q8SzA2pijq25Zc GqQI2a1kAiPfa6Uctc4t+LI/r9L0T6jnHs5iGjlZTY+8nWCFBhWC5/IvCtXa5pb2A5yr uamw== X-Forwarded-Encrypted: i=1; AJvYcCWRGJO1Ig7AwHYD3vL5o6ofeX0OziPTRRqfyitdvfiNVq87Ed5Qp5LvnispKLc/0PUcSz7/vgxi3OWA@lists.postgresql.org X-Gm-Message-State: AOJu0YzLCbRFQR9E4flKluCFmNym2+qWtOgRkVN950B/Bz9B32LQAbeV 4z6asbHy7IfaxRrvUg0ZKP4l2V1JqTm7FKDvXacrKjXevpD5mc0j8OaMBtnKyJEdtBI= X-Gm-Gg: ASbGnctxu36p3FUaE1UCL9Bx3LzIH2LUaLH+nbof4NDZB54/3ZagW1aSal8n79/bkU3 1ACYzzwZrs28lW6WHEfJLZIKTBay/SSlSpoR26100WM7kreMhuZt6Px9Ph3rv/Xq+LKVkxVVGu9 7XzRQhJkVYoUa6LCKl+91WKg09mxBpWa5aIZ+xizBe48NwDmihzeKeCMLTPgXskxX36ZXs6+AG5 3Mz6pnYC0v6jIYSvZAuRx4j9756ADGkm/aMtzJKiB5jIfiZ8O+Y9lU0LnIkJaihgX7n8zfpMvP/ QVYYwv933D8aleoWrzfN72COfCX0aOMT/PwoU+4t0mg5YinH71LLTAiPkxP0FqPOZ0nE3xqvr7B m6r8qxJWvhVEd1Jdh8vIKZcfH85gj3LeJEocQ02P47aJZfA3DidXK4EnUF30IvRreNpsel6vqNx +lZcU8JYcF+w== X-Google-Smtp-Source: AGHT+IF5R1/+2A9lxyAk6Ksosrn469R/FzCd0s7uc8dMFxt3HN6zxpjwRuzbEd5k9htnWbUM4GfhTw== X-Received: by 2002:a05:600c:3505:b0:456:18d4:5f7b with SMTP id 5b1f17b1804b1-45618d463d5mr23549775e9.9.1752441080047; Sun, 13 Jul 2025 14:11:20 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D (ip-185-104-138-49.ptr.icomera.net. [185.104.138.49]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454dd43915dsm113491475e9.7.2025.07.13.14.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 14:11:19 -0700 (PDT) Message-ID: <097e693ea6cc3541cbcd72c915d7d492c26930c0.camel@cybertec.at> Subject: Re: please define 'statement' in the glossary From: Laurenz Albe To: Tom Lane Cc: petermittere@gmail.com, pgsql-docs@lists.postgresql.org Date: Sun, 13 Jul 2025 23:11:14 +0200 In-Reply-To: <270191.1752420426@sss.pgh.pa.us> References: <175223006802.3157505.14764328206246105568@wrigleys.postgresql.org> <15139c5d218754350e4870062f90ff0e85490290.camel@cybertec.at> <270191.1752420426@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 2025-07-13 at 11:27 -0400, Tom Lane wrote: > Laurenz Albe writes: > > After looking at the code, I guess what made Tom add the remark in comm= it > > eaf8f312c754 was the fact that an SQL statement is not necessarily proc= essed > > in a single go: with the extended query protocol (see chapter 52.2.3), > > there is a "parse", a "bind" and an "execute" message from the client, = and > > each one sets the timestamp reported by statement_timestamp() to a new > > value. So, technically, statement_timestamp() has a different value wh= en > > the statement is parsed than when it is executed. >=20 > > However, what matters to the client is the value when the statement sta= rts > > executing, because that's the value that will be reported. >=20 > > So I'd argue that we should remove the parenthetical remark. It confus= es > > more than it enlightens, and whoever needs to know that level of detail > > had better read the code anyway. >=20 > After re-reading that text, I feel like the parenthetical remark is > fine, and the real problem is that I used "statement" and "command" > more or less interchangeably in successive sentences. Perhaps > s/command/statement/g throughout the paragraph would improve matters? > Although "statement message" doesn't feel right, so maybe leave that > one alone. Changing "command" to "statement" would be a good move. I guess I get the remark now: it wants to say that a) statement_timestamp() shows the time when the client message that started the execution of the current SQL statement reached the server and b) the timestamp isn't reset for nested statements Perhaps the remark should say "protocol message" or "frontend-backend protocol message" to make clear that we are not talking about an SQL statement here. Yours, Laurenz Albe