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 1ubCcW-00EzpA-4F for pgsql-docs@arkaria.postgresql.org; Mon, 14 Jul 2025 06:25:00 +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 1ubCcU-003wsE-1t for pgsql-docs@arkaria.postgresql.org; Mon, 14 Jul 2025 06:24:58 +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 1ubCcT-003ws6-Pi for pgsql-docs@lists.postgresql.org; Mon, 14 Jul 2025 06:24:58 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ubCcS-007BV0-17 for pgsql-docs@lists.postgresql.org; Mon, 14 Jul 2025 06:24:57 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4530921461aso24760525e9.0 for ; Sun, 13 Jul 2025 23:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752474294; x=1753079094; 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=DNWSCX5FbhN5nN9F9ggA7w8yRwUrAvmuJNZLJVDUTeY=; b=m6bZz4zMzmrg4SY9RBE28RRUmJ+CHwQJ+N2BlZE9WNWzPnTyhLEug8TDhFkZt4iQo4 h3q6a6fkcne3N534XkOU/fpqRCrVP/5+P38pRaFtYKKCQEzXfTZ1m2S1rX2boAzGjJDK HhD0uWALO6w0zlSMwIA1sTRZrGJFw+RDHkiGHWzhiQQr+XcWAP5YSOy0xTKeLjIDMMX3 /EAL0xzUk7iWQDY7a3MOoTnrwgNf5fqjwkUwJMaaHqxcA0VxCeNcZqrLv/QRAl46q4A4 SMrgpEqjril/rzwpAIhD3jX/bm9ZZQb+JSBX5CS0t0X9NluSCMCBP8JEY0uVt2RK4FfU qIHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752474294; x=1753079094; 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=DNWSCX5FbhN5nN9F9ggA7w8yRwUrAvmuJNZLJVDUTeY=; b=vKw4vT4m0AJL8lnXQPaZLe1/lEsR8j9BGs74KB38H94/nxi2DISFWOZscusbV7nOk3 SdzTsUuwtouKfuLgQFA1iZeRmpRR8pPs/Zecdb8+N333i9fu8/AJ9PAPotUuoA39jYBh EozSYmB1S5a3tpvLf0HElzlFFPITsMYWgdpB8uDyJCVu5/41D4E6ja/KoMLtm0gutLBd /631Gsgy9zybI3cUrrzWDI6AcgI2HkPzcJvGaZKTH3vXEUfOTDsJ2TztP9inAjcI72wn Cuz6eG6CrLx/ELRNEQMF7S+ftSumMhz2Ew88mMDZ49Hmrma8DV8wzVAKjXkvsFrLwPle 14pw== X-Forwarded-Encrypted: i=1; AJvYcCX+tuZ6IUb2SAD+HF4qJkPB1w8vJ5wbyClYQi11xflJvSfXCFtZcchqOt4WAItzNooViLiBarL44KEr@lists.postgresql.org X-Gm-Message-State: AOJu0Yy29MnZnMyS0Up5779sj5PV808j6P0rCX4KJSISKpkcZj0DON3A 7jt3trwM8PBYdi1nEciZIqgXrhbFDRwRoA3cPHfVNPlqqV3IMlpb5EaWBUzr6Ftki+4= X-Gm-Gg: ASbGncvhA1k3KK3xg9R3v7XbTnJboI82p/O5MzMgpnEppMybtIG6CzH5vJYdhbLANx9 6H4cJ438QF37DkxS7goPUqCXAYN0El362Wy0aMjscSx3Q1DkOs1hErsABL7vuLqKpfILq6X+cVn +msJaUIZL+xMqmHP7OGBq10M1QnibYIMjh1+cpYPY0x1a4R/dnXzPNClWd6FbAhvCqrfz9geKKV gjLErDLwMkV8dVFpjk2JTDXSZpffa/CQw0SyQ6h9xpmG4DEDr25Xu42IsN4coowOWIftlbOIgm7 jfP04uXHT4/hnNnIqNw+GeAWLWazxB+NuoLA5F9qcl5lrQh5Wna5Jxd69Lpjgm0heur9hODiSJO RtDTrRn/rod5GMUtWB8FQ9k+wJrIXfe0HMAO5eT947jhe1DAxGPYn X-Google-Smtp-Source: AGHT+IFtjiqhLeOcyERIOZQ6CXJnJL45+f+dXTxLfm85ZjxHdN+6a9COxv0GQxdYlKJv2nnV6b2VAw== X-Received: by 2002:a05:600c:444d:b0:450:d3b9:a5fc with SMTP id 5b1f17b1804b1-45565edcebfmr92847545e9.27.1752474294520; Sun, 13 Jul 2025 23:24:54 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:260:9ccc:8644:4a36:7b7f:6c65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454dd4b32d8sm122056855e9.17.2025.07.13.23.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 23:24:54 -0700 (PDT) Message-ID: Subject: Re: please define 'statement' in the glossary From: Laurenz Albe To: "David G. Johnston" , Tom Lane Cc: petermittere@gmail.com, pgsql-docs@lists.postgresql.org Date: Mon, 14 Jul 2025 08:24:53 +0200 In-Reply-To: References: <175223006802.3157505.14764328206246105568@wrigleys.postgresql.org> <15139c5d218754350e4870062f90ff0e85490290.camel@cybertec.at> <270191.1752420426@sss.pgh.pa.us> <097e693ea6cc3541cbcd72c915d7d492c26930c0.camel@cybertec.at> <456003.1752442676@sss.pgh.pa.us> <458204.1752443813@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 17:32 -0700, David G. Johnston wrote: > On Sun, Jul 13, 2025 at 2:57=E2=80=AFPM Tom Lane wrot= e: > > ... so concretely, about like this? I am fine with the patch as it is. > We seldom if ever resort to including descriptions=C2=A0involving=C2=A0th= e fe/be protocol > in the SQL portion of the documentation - rightly considering (IMO) those= to be > implementation details (e.g., we don't even directly mention simple proto= col in > "psql -c" - though we do link to it under "multi-statement commands"). > Is there no way to avoid that here? Well, I would have gladly removed the parenthetical remark, thinking that i= f somebody needed to know precisely, she'd read up in the code. But there is also nothing evil about hints for the initiated, lest they are of a kind that can confuse beginners. > =C2=A0 I'd be ok if we'd limit this to= a > distinction between the simple protocol and the extended protocol since, = as a > volatile function, it isn't even like statement_timestamp can be seen in = extended > protocol aside from when execute is sent.=C2=A0 So the special case where= it doesn't > behave as expected is a simple protocol multi-statement command. It is STABLE, not VOLATILE, as befits the name, but yes, I see your point. > =C2=A0 An= example in > psql would serve to make this much more clear than any wording can do. > Possibly added here or as part of the existing documentation that 'psql -= c' > points to [1].=C2=A0 Which probably could be pointed to from here as well= . Perhaps - but I feel uneasy about adding even more documentation. If we sh= ow how statement_timestamp() does *not* work as expected with a multi-statemen= t command, we might confuse the reader even more. With the improved parenthe= tical remark, I'd expect anybody with superficial knowledge of PostgreSQL to just skip over the remark, with little damage done ("Ah, some comment about inte= rnals that they couldn't help making."). But if we add examples, we should be ready to explain in depth why it is th= e way it is, and then we would have to get even deeper into the discussion of the protocol that you bemoaned at the beginning of your mail. > Seems also like maybe SPI should be mentioned explicitly here since it se= ems to > act like a client in a relevant way.=C2=A0 I'm assuming a statement_times= tamp executed > within a function will return the same timestamp the calling statement wo= uld. Well, in this case it doesn't act like a client. That would mean dragging = up even more details from a section of the documentation that is only of inter= est to hackers. I think we should let the lions sleep. The documentation of the built-in functions is mostly of interest to application developers and writers of SQ= L and PL/pgSQL, and expanding on SPI and the client-server protocol isn't wha= t's asked for here. The documentation should be detailed, but there is a fine line that you shouldn't cross if you don't want to confuse the reader. The parenthetical remark is hopefully enough to get the interested reader on the right track. Yours, Laurenz Albe