Thread: correction

correction

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/transaction-iso.html
Description:

in this page: https://www.postgresql.org/docs/14/transaction-iso.html

under the Table 13.1 section, if we search for "phantom reads. Stricter
behavior is permitted by the SQL standard", do we mean "Looser behaviour"?

Re: correction

From
Laurenz Albe
Date:
On Wed, 2022-05-11 at 00:33 +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/14/transaction-iso.html
> Description:
> 
> in this page: https://www.postgresql.org/docs/14/transaction-iso.html
> 
> under the Table 13.1 section, if we search for "phantom reads. Stricter
> behavior is permitted by the SQL standard", do we mean "Looser behaviour"?

What is meant is "The SQL standard allows an implementation to implement
stricter behavior than required by the standard; it only defines the things
that are *not* allowed to happen at a certain isolation level.  So it is for
example fine for PostgreSQL not to allow dirty reads in READ UNCOMMITTED
isolation level."

Perhaps this could be rewritten to be clearer; it is indeed easy to
misunderstand that sentence.

Yours,
Laurenz Albe



Re: correction

From
Bruce Momjian
Date:
On Wed, May 11, 2022 at 12:36:11PM +0200, Laurenz Albe wrote:
> On Wed, 2022-05-11 at 00:33 +0000, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> > 
> > Page: https://www.postgresql.org/docs/14/transaction-iso.html
> > Description:
> > 
> > in this page: https://www.postgresql.org/docs/14/transaction-iso.html
> > 
> > under the Table 13.1 section, if we search for "phantom reads. Stricter
> > behavior is permitted by the SQL standard", do we mean "Looser behaviour"?
> 
> What is meant is "The SQL standard allows an implementation to implement
> stricter behavior than required by the standard; it only defines the things
> that are *not* allowed to happen at a certain isolation level.  So it is for
> example fine for PostgreSQL not to allow dirty reads in READ UNCOMMITTED
> isolation level."
> 
> Perhaps this could be rewritten to be clearer; it is indeed easy to
> misunderstand that sentence.

How is this attached patch's wording?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson


Attachment

Re: correction

From
Laurenz Albe
Date:
On Fri, 2022-05-13 at 16:36 -0400, Bruce Momjian wrote:
> On Wed, May 11, 2022 at 12:36:11PM +0200, Laurenz Albe wrote:
> > On Wed, 2022-05-11 at 00:33 +0000, PG Doc comments form wrote:
> > > The following documentation comment has been logged on the website:
> > > 
> > > Page: https://www.postgresql.org/docs/14/transaction-iso.html
> > > Description:
> > > 
> > > in this page: https://www.postgresql.org/docs/14/transaction-iso.html
> > > 
> > > under the Table 13.1 section, if we search for "phantom reads. Stricter
> > > behavior is permitted by the SQL standard", do we mean "Looser behaviour"?
> > 
> > What is meant is "The SQL standard allows an implementation to implement
> > stricter behavior than required by the standard; it only defines the things
> > that are *not* allowed to happen at a certain isolation level.  So it is for
> > example fine for PostgreSQL not to allow dirty reads in READ UNCOMMITTED
> > isolation level."
> > 
> > Perhaps this could be rewritten to be clearer; it is indeed easy to
> > misunderstand that sentence.
> 
> How is this attached patch's wording?
> 
> diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml
> index 341fea524a..244694b07f 100644
> --- a/doc/src/sgml/mvcc.sgml
> +++ b/doc/src/sgml/mvcc.sgml
> @@ -277,8 +277,8 @@
> 
>     <para>
>      The table also shows that PostgreSQL's Repeatable Read implementation
> -    does not allow phantom reads.  Stricter behavior is permitted by the
> -    SQL standard: the four isolation levels only define which phenomena
> +    does not allow phantom reads.  The SQL standard allows more restrictive
> +    behavior:  the four isolation levels only define which phenomena
>      must not happen, not which phenomena <emphasis>must</emphasis> happen.
>      The behavior of the available isolation levels is detailed in the
>      following subsections.

I think that suffers from the same problem: izt sounds like the standard allows
stricter behavior than PostgreSQL.

How about:

  The table also shows that PostgreSQL's Repeatable Read implementation
  does not allow phantom reads.  That is fine, because the SQL standard only
  specifies which anomalies must <emphasis>not</enphasis> occur at a certain
  isolation level.  It is no problem if an implementation provides higher
  guarantees than required.
  The behavior of the available isolation levels is detailed in the
  following subsections.

Yours,
Laurenz Albe



Re: correction

From
"David G. Johnston"
Date:


On Fri, May 13, 2022 at 2:49 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Fri, 2022-05-13 at 16:36 -0400, Bruce Momjian wrote:
> On Wed, May 11, 2022 at 12:36:11PM +0200, Laurenz Albe wrote:
> > On Wed, 2022-05-11 at 00:33 +0000, PG Doc comments form wrote:
> > > The following documentation comment has been logged on the website:
> > >
> > > Page: https://www.postgresql.org/docs/14/transaction-iso.html
> > > Description:
> > >
> > > in this page: https://www.postgresql.org/docs/14/transaction-iso.html
> > >
> > > under the Table 13.1 section, if we search for "phantom reads. Stricter
> > > behavior is permitted by the SQL standard", do we mean "Looser behaviour"?
> >
> > What is meant is "The SQL standard allows an implementation to implement
> > stricter behavior than required by the standard; it only defines the things
> > that are *not* allowed to happen at a certain isolation level.  So it is for
> > example fine for PostgreSQL not to allow dirty reads in READ UNCOMMITTED
> > isolation level."
> >
> > Perhaps this could be rewritten to be clearer; it is indeed easy to
> > misunderstand that sentence.
>
> How is this attached patch's wording?
>
> diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml
> index 341fea524a..244694b07f 100644
> --- a/doc/src/sgml/mvcc.sgml
> +++ b/doc/src/sgml/mvcc.sgml
> @@ -277,8 +277,8 @@
>
>     <para>
>      The table also shows that PostgreSQL's Repeatable Read implementation
> -    does not allow phantom reads.  Stricter behavior is permitted by the
> -    SQL standard: the four isolation levels only define which phenomena
> +    does not allow phantom reads.  The SQL standard allows more restrictive
> +    behavior:  the four isolation levels only define which phenomena
>      must not happen, not which phenomena <emphasis>must</emphasis> happen.
>      The behavior of the available isolation levels is detailed in the
>      following subsections.

I think that suffers from the same problem: izt sounds like the standard allows
stricter behavior than PostgreSQL.

How about:

  The table also shows that PostgreSQL's Repeatable Read implementation
  does not allow phantom reads.  That is fine, because the SQL standard only
  specifies which anomalies must <emphasis>not</enphasis> occur at a certain
  isolation level.  It is no problem if an implementation provides higher
  guarantees than required.
  The behavior of the available isolation levels is detailed in the
  following subsections.



How about this?

I really dislike the table having "Allow, but" - it's not allowed and having the reader have to interpret "but" to understand the "not possible" aspect of the cell seems unnecessary.  The "in PG" qualification and a note makes it perfectly clear where we deviate from the standard - on the binary option.

I also suggest (but did not implement) taking out the mention of the RR exception from here and just leaving the main section where we repeat for a second time what is self-evident from reading the table (so, three mentions of this implementation choice):

"This is a stronger guarantee than is required by the SQL standard for this isolation level, and prevents all of the phenomena described in Table 13.1 except for serialization anomalies. As mentioned above, this is specifically allowed by the standard, which only describes the minimum protections each isolation level must provide."

David J.

         <entry>
-         Allowed, but not in PG
+         Not possible in PG
         </entry>
         <entry>
          Possible
@@ -238,7 +238,7 @@
          Not possible
         </entry>
         <entry>
-         Allowed, but not in PG
+         Not possible in PG
         </entry>
         <entry>
          Possible
@@ -266,6 +266,12 @@
      </tgroup>
     </table>
 
+   <para>
+    Two entries in the above table are qualified by "in PG".  For these,
+    the SQL standard deems the corresponding anomaly possible at that
+    isolation level but permits implementations to make it impossible.
+   </para>
Attachment

Re: correction

From
Bruce Momjian
Date:
On Fri, May 13, 2022 at 11:49:09PM +0200, Laurenz Albe wrote:
> I think that suffers from the same problem: izt sounds like the standard allows
> stricter behavior than PostgreSQL.
> 
> How about:
> 
>   The table also shows that PostgreSQL's Repeatable Read implementation
>   does not allow phantom reads.  That is fine, because the SQL standard only
>   specifies which anomalies must <emphasis>not</enphasis> occur at a certain
>   isolation level.  It is no problem if an implementation provides higher
>   guarantees than required.
>   The behavior of the available isolation levels is detailed in the
>   following subsections.

How is this, attached?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson


Attachment

Re: correction

From
"David G. Johnston"
Date:
On Tue, Jun 7, 2022 at 2:07 PM Bruce Momjian <bruce@momjian.us> wrote:


How is this, attached?


Works for me.

Capital "S" in Standard as a proper name? (mind grepping this to see how consistent we are one way or the other, I'm not setup for that at the moment)

David J.

Re: correction

From
Bruce Momjian
Date:
On Tue, Jun  7, 2022 at 02:40:41PM -0700, David G. Johnston wrote:
> On Tue, Jun 7, 2022 at 2:07 PM Bruce Momjian <bruce@momjian.us> wrote:
> 
> 
> 
>     How is this, attached?
> 
> 
> 
> Works for me.
> 
> Capital "S" in Standard as a proper name? (mind grepping this to see how
> consistent we are one way or the other, I'm not setup for that at the moment)

Well, that's a good question.  Seems we use "SQL standard", and I found
one place where we capitalize "Standard", so fixed too in this patch.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson


Attachment

Re: correction

From
"David G. Johnston"
Date:
On Tue, Jun 7, 2022 at 4:51 PM Bruce Momjian <bruce@momjian.us> wrote:
On Tue, Jun  7, 2022 at 02:40:41PM -0700, David G. Johnston wrote:
> On Tue, Jun 7, 2022 at 2:07 PM Bruce Momjian <bruce@momjian.us> wrote:
>
>
>
>     How is this, attached?
>
>
>
> Works for me.
>
> Capital "S" in Standard as a proper name? (mind grepping this to see how
> consistent we are one way or the other, I'm not setup for that at the moment)

Well, that's a good question.  Seems we use "SQL standard", and I found
one place where we capitalize "Standard", so fixed too in this patch.

+1

Thanks!

David J.

Re: correction

From
Tom Lane
Date:
Bruce Momjian <bruce@momjian.us> writes:
> +    <emphasis>not</enphasis> occur at certain isolation levels;  higher

The docs toolchain is not gonna like that.

            regards, tom lane



Re: correction

From
Bruce Momjian
Date:
On Tue, Jun  7, 2022 at 08:00:16PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > +    <emphasis>not</enphasis> occur at certain isolation levels;  higher
> 
> The docs toolchain is not gonna like that.

You are correct.  I should have tested, updated patch attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson


Attachment

Re: correction

From
"David G. Johnston"
Date:
On Tue, Jun 7, 2022 at 5:26 PM Bruce Momjian <bruce@momjian.us> wrote:
On Tue, Jun  7, 2022 at 08:00:16PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > +    <emphasis>not</enphasis> occur at certain isolation levels;  higher
>
> The docs toolchain is not gonna like that.

You are correct.  I should have tested, updated patch attached.


I can confirm the build and am still good with the content.

David J.

Re: correction

From
Bruce Momjian
Date:
On Tue, Jun  7, 2022 at 07:51:20PM -0400, Bruce Momjian wrote:
> On Tue, Jun  7, 2022 at 02:40:41PM -0700, David G. Johnston wrote:
> > On Tue, Jun 7, 2022 at 2:07 PM Bruce Momjian <bruce@momjian.us> wrote:
> > 
> > 
> > 
> >     How is this, attached?
> > 
> > 
> > 
> > Works for me.
> > 
> > Capital "S" in Standard as a proper name? (mind grepping this to see how
> > consistent we are one way or the other, I'm not setup for that at the moment)
> 
> Well, that's a good question.  Seems we use "SQL standard", and I found
> one place where we capitalize "Standard", so fixed too in this patch.

Applied to all supported branches.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson