Re: Questions about document "Concurrenry control" section

Lists: pgsql-general
From: iseki zero <admin(at)iseki(dot)space>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Questions about document "Concurrenry control" section
Date: 2024-10-09 10:07:09
Message-ID: 7901c7e4-69c6-4bb2-8e9d-ad556d493717@iseki.space
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hello,

I found it difficult to understanding some paragraph in the document
"Concurrency control" section.

> The Repeatable Read mode provides a rigorous guarantee that each
transaction sees a completely stable view of the database. However, this
view will not necessarily always be consistent with some serial (one at
a time) execution of concurrent transactions of the same level. For
example, even a read-only transaction at this level may see a control
record updated to show that a batch has been completed but/not/see one
of the detail records which is logically part of the batch because it
read an earlier revision of the control record. Attempts to enforce
business rules by transactions running at this isolation level are not
likely to work correctly without careful use of explicit locks to block
conflicting transactions.

At:
/docs/17/transaction-iso.html#XACT-REPEATABLE-READ:~:text=The%20Repeatable%20Read%20mode,to%20block%20conflicting%20transactions.

Specifically, I can't understand the example. Why in an earlier
revision, the control record show that the batch has been completed? In
my recognization, the control record state transation should be
"running" -> "completed". And only after all batch operation completed
then the control record will be changed to "completed".

The another big problem is, I interpret the whole batch operation is in
one transaction. So, we can read updates from another uncommited yet
transaction?? I read the front paragraph(Read Committed), the locking
behaviour will effect the read view, and I understand the behaviour
might still be exists in Repeatable Read. But the example said,
read-only transaction.

Thank you

iseki zero


From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: iseki zero <admin(at)iseki(dot)space>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-09 14:51:16
Message-ID: 35d3e799d47700dc217b1f211aa0e0d5f4de4e67.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Wed, 2024-10-09 at 18:07 +0800, iseki zero wrote:
> I found it difficult to understanding some paragraph in the document
> "Concurrency control" section.
>
>  > The Repeatable Read mode provides a rigorous guarantee that each
> transaction sees a completely stable view of the database. However, this
> view will not necessarily always be consistent with some serial (one at
> a time) execution of concurrent transactions of the same level. For
> example, even a read-only transaction at this level may see a control
> record updated to show that a batch has been completed but/not/see one
> of the detail records which is logically part of the batch because it
> read an earlier revision of the control record. Attempts to enforce
> business rules by transactions running at this isolation level are not
> likely to work correctly without careful use of explicit locks to block
> conflicting transactions.
>
> At:
> /docs/17/transaction-iso.html#XACT-REPEATABLE-READ:~:text=The%20Repeatable%20Read%20mode,to%20block%20conflicting%20transactions.
>
> Specifically, I can't understand the example.

I think this is referring to this example:
https://wiki.postgresql.org/wiki/SSI#Deposit_Report

Yours,
Laurenz Albe


From: iseki <admin(at)iseki(dot)space>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-11 13:00:25
Message-ID: a767cf97-1743-4dd7-add2-4eb0587efb25@iseki.space
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Oh sorry, I should use [reply to all] instead of [reply]. I don't have
much experience with mailing lists...

But why the mailing list haven't use the "Reply-To" header specify where
to reply? Because the mail is you send to me directly?

Thank you.

On 2024/10/11 14:53, Laurenz Albe wrote:
> On Fri, 2024-10-11 at 11:04 +0800, admin(at)iseki(dot)space wrote:
>> Maybe add the whole example or the URL to the document is better?
> You shouldn't address that reply to me personally...
>
> Yours,
> Laurenz Albe


From: Erik Wienhold <ewie(at)ewie(dot)name>
To: iseki <admin(at)iseki(dot)space>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-11 13:46:56
Message-ID: a1619427-47d0-4c2a-b187-0246343815c4@ewie.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 2024-10-11 15:00 +0200, iseki wrote:
> Oh sorry, I should use [reply to all] instead of [reply]. I don't have much
> experience with mailing lists...
>
> But why the mailing list haven't use the "Reply-To" header specify where to
> reply? Because the mail is you send to me directly?

The message author sets Reply-To, if necessary, according to RFC 5322.
Are there mailing lists that actually set this header?

--
Erik


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: iseki <admin(at)iseki(dot)space>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-11 14:19:13
Message-ID: 2852693.1728656353@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토 결과SQL

Erik Wienhold <ewie(at)ewie(dot)name> writes:
> On 2024-10-11 15:00 +0200, iseki wrote:
>> But why the mailing list haven't use the "Reply-To" header specify where to
>> reply? Because the mail is you send to me directly?

> The message author sets Reply-To, if necessary, according to RFC 5322.
> Are there mailing lists that actually set this header?

It's been done in the past, but current practice is strongly against
it. For example, in your own message that I'm replying to, there's
a DKIM signature (RFC 6376):

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001;
t=1728654419;
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:
in-reply-to:in-reply-to:references:references;
bh=7w7CHebdKaXtlhCMxa/jNIcoEy1tFhZmzOD+dT7nP8k=;
b=K3s//HzYXU+chTDeY5p/wGwd5eglESiaugVSpGWo49ryL9ajLdimYMD3uIc3rr8PglZizV
nk2wDiMsHnLR0EAgKsGzNvtxt4N9hHxMk7UI3F4XOVYqnemk95YVRNpFpEFww833uUqA+9
RPypj/ezsKbi2vBzzXIoZ+Tf3t6XfuZYf6poq1J+ud0X278yQMnA1XbZNsenQkCWoYPiXb
yklxY2Nbp9NyiDHCDQ0KPYAT6/0ttzbprNhgSzhN7LND6ehUvLlsmKG3rwqby2LmFRwliQ
RDZ4MAxEzZKfOr8HGnubQf8FdQPGw6jlAn3U8199c+3QcIAWJ99Wrtb5rQPdEw==

That lists "reply-to" as one of the signed header fields. So if the
mailing list were to modify Reply-To (including inserting one where
there was none before) a DKIM-verifying recipient would regard the
message as a forgery.

regards, tom lane


From: iseki zero <admin(at)iseki(dot)space>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Erik Wienhold <ewie(at)ewie(dot)name>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 02:25:08
Message-ID: 32ae50a3-b6a3-4ca2-8051-9b0261ac430b@iseki.space
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg무지개 토토SQL

So, should I use the [reply to all] button? I'm afraid the receipt list
will growing to have too many address.

BTW, I'm using Thunderbird. If you have better software, tell me please.

Sorry for my poor English.

iseki zero.

在 2024/10/11 22:19, Tom Lane 写道:
> Erik Wienhold<ewie(at)ewie(dot)name> writes:
>> On 2024-10-11 15:00 +0200, iseki wrote:
>>> But why the mailing list haven't use the "Reply-To" header specify where to
>>> reply? Because the mail is you send to me directly?
>> The message author sets Reply-To, if necessary, according to RFC 5322.
>> Are there mailing lists that actually set this header?
> It's been done in the past, but current practice is strongly against
> it. For example, in your own message that I'm replying to, there's
> a DKIM signature (RFC 6376):
>
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001;
> t=1728654419;
> 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:
> in-reply-to:in-reply-to:references:references;
> bh=7w7CHebdKaXtlhCMxa/jNIcoEy1tFhZmzOD+dT7nP8k=;
> b=K3s//HzYXU+chTDeY5p/wGwd5eglESiaugVSpGWo49ryL9ajLdimYMD3uIc3rr8PglZizV
> nk2wDiMsHnLR0EAgKsGzNvtxt4N9hHxMk7UI3F4XOVYqnemk95YVRNpFpEFww833uUqA+9
> RPypj/ezsKbi2vBzzXIoZ+Tf3t6XfuZYf6poq1J+ud0X278yQMnA1XbZNsenQkCWoYPiXb
> yklxY2Nbp9NyiDHCDQ0KPYAT6/0ttzbprNhgSzhN7LND6ehUvLlsmKG3rwqby2LmFRwliQ
> RDZ4MAxEzZKfOr8HGnubQf8FdQPGw6jlAn3U8199c+3QcIAWJ99Wrtb5rQPdEw==
>
> That lists "reply-to" as one of the signed header fields. So if the
> mailing list were to modify Reply-To (including inserting one where
> there was none before) a DKIM-verifying recipient would regard the
> message as a forgery.
>
> regards, tom lane
>
>


From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: iseki zero <admin(at)iseki(dot)space>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Erik Wienhold <ewie(at)ewie(dot)name>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 02:38:40
Message-ID: CAKFQuwZJ-BjwUdV6=ACfKwrYQoHZdRZjKdHgbTkakfb-qphE1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Friday, October 11, 2024, iseki zero <admin(at)iseki(dot)space> wrote:

> So, should I use the [reply to all] button? I'm afraid the receipt list
> will growing to have too many address.
>
>
Yes, just use reply-all. The to list only grows when people reply, and it
is a mailing list - all these people are getting the email anyway…this just
lets them filter on things they have replied to.

David J.


From: admin(at)iseki(dot)space
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 03:10:46
Message-ID: 2fb0b1df-c06c-4a0a-af2a-ea57ecb6ed79@iseki.space
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I found. Maybe we should reply to the mailing list only. Otherwise we'll receive multiple copies of the emails.


From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: admin(at)iseki(dot)space, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 04:21:16
Message-ID: 0509ee4e-75dd-409b-b30b-b136805fbd15@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 10/11/24 20:10, admin(at)iseki(dot)space wrote:
> I found. Maybe we should reply to the mailing list only. Otherwise we'll
> receive multiple copies of the emails.
>
>

Not if you go here:

https://lists.postgresql.org/manage/

and check:

Don't receive an extra copy of mails when listed in To or CC fields

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com


From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 10:09:05
Message-ID: 20241012100905.lkba5t3pbrrs4cg6@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 2024-10-12 10:25:08 +0800, iseki zero wrote:
> So, should I use the [reply to all] button?

This mailing-list (like most lists) sets the "List-Post" header:

List-Post: <mailto:pgsql-general(at)lists(dot)postgresql(dot)org>

So the best thing would be for the mail program to detect that and offer
a [reply to list] button. Not many do, though, so [reply to all] is
probably your best choice.

> I'm afraid the receipt list will growing to have too many address.

Not much of a problem since usually there won't be that many people
participating in a thread.

> BTW, I'm using Thunderbird. If you have better software, tell me please.

I'm using (neo)mutt, but these days the limitations of a text-only
mailer can be quite noticeable.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"


From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 10:17:19
Message-ID: 20241012101719.k5iyqptjo6sx2sro@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 2024-10-11 21:21:16 -0700, Adrian Klaver wrote:
> On 10/11/24 20:10, admin(at)iseki(dot)space wrote:
> > I found. Maybe we should reply to the mailing list only. Otherwise we'll
> > receive multiple copies of the emails.
> >
> >
>
> Not if you go here:
>
> https://lists.postgresql.org/manage/
>
> and check:
>
> Don't receive an extra copy of mails when listed in To or CC fields

Yes, but that's the wrong way around. Then I get some mails only
directly and some only through the list, which makes proper filtering
hard to impossible. For me it's much better to get all the mails through
the list (so I can use the List-ID header to filter them into the
appropriate folder) and live with the extra copies in my inbox. I would
prefer to not get those extra copies, but there is nothing the list can
do about them, that's under the control of the sender.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"


From: Arbol One <ArbolOne(at)hotmail(dot)ca>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 11:30:20
Message-ID: BYAPR12MB2808BFEA8A0EA20D889D6069BA7A2@BYAPR12MB2808.namprd12.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Yes, this is IMOP, the best way.
I have set up Thunderbird to throw everything that is not in my contact
list to Trash, thus your email will never be read by me if you don't use
- Reply to Mailing list -. Just saying.

On 2024-10-11 11:10 p.m., admin(at)iseki(dot)space wrote:
> I found. Maybe we should reply to the mailing list only. Otherwise
> we'll receive multiple copies of the emails.
>
>
>
--
*/ArbolOne ™/*
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing
free services to charitable organizations.
ArbolOne's development on Java, PostgreSQL, HTML and Jakarta EE is in
progress [ í ]


From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-12 16:02:37
Message-ID: 31b8f5be-ba8d-4252-bcd6-4cd6f2742df9@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 10/12/24 03:17, Peter J. Holzer wrote:
> On 2024-10-11 21:21:16 -0700, Adrian Klaver wrote:
>> On 10/11/24 20:10, admin(at)iseki(dot)space wrote:
>>> I found. Maybe we should reply to the mailing list only. Otherwise we'll
>>> receive multiple copies of the emails.
>>>
>>>
>>
>> Not if you go here:
>>
>> https://lists.postgresql.org/manage/
>>
>> and check:
>>
>> Don't receive an extra copy of mails when listed in To or CC fields
>
> Yes, but that's the wrong way around. Then I get some mails only
> directly and some only through the list, which makes proper filtering
> hard to impossible. For me it's much better to get all the mails through
> the list (so I can use the List-ID header to filter them into the
> appropriate folder) and live with the extra copies in my inbox. I would
> prefer to not get those extra copies, but there is nothing the list can
> do about them, that's under the control of the sender.

Not following. If it goes through the list either by 'Reply to list' or
Reply All' it is going to pick up the List-ID and be filtered. All the
setting does is make sure you don't get extra copies when your email is
in the To or CC fields, which is the list doing something about them.
I've been using this for years and aside from some general list/email
issues it has worked as advertised.

>
> hp
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com


From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about document "Concurrenry control" section
Date: 2024-10-15 22:24:01
Message-ID: 20241015222401.qtxdjrwtbvmh4aht@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 2024-10-12 09:02:37 -0700, Adrian Klaver wrote:
> On 10/12/24 03:17, Peter J. Holzer wrote:
> > On 2024-10-11 21:21:16 -0700, Adrian Klaver wrote:
> > > On 10/11/24 20:10, admin(at)iseki(dot)space wrote:
> > > > I found. Maybe we should reply to the mailing list only. Otherwise we'll
> > > > receive multiple copies of the emails.
> > > >
> > > >
> > >
> > > Not if you go here:
> > >
> > > https://lists.postgresql.org/manage/
> > >
> > > and check:
> > >
> > > Don't receive an extra copy of mails when listed in To or CC fields
> >
> > Yes, but that's the wrong way around. Then I get some mails only
> > directly and some only through the list, which makes proper filtering
> > hard to impossible. For me it's much better to get all the mails through
> > the list (so I can use the List-ID header to filter them into the
> > appropriate folder) and live with the extra copies in my inbox. I would
> > prefer to not get those extra copies, but there is nothing the list can
> > do about them, that's under the control of the sender.
>
> Not following. If it goes through the list either by 'Reply to list' or
> Reply All' it is going to pick up the List-ID and be filtered. All the
> setting does is make sure you don't get extra copies when your email is in
> the To or CC fields, which is the list doing something about them.

What it is doing about them is to drop the message (it can't do anything
else). So if I send a message to adrian(dot)klaver(at)aklaver(dot)com,
pgsql-general(at)lists(dot)postgresql(dot)org you will get the copy sent directly
to your address (which won't have any List headers set), but not the
copy sent to pgsql-general(at)lists(dot)postgresql(dot)org(dot) So basically you don't
have any reliable way to detect that the message was sent to the
mailing-list (the best bet is probably to filter on the To: and Cc:
headers, but that may fail (both with false positives and false
negatives); some mailing-lists put a tag in the subject, but nobody
removes that for a private reply.

> I've been using this for years and aside from some general list/email
> issues it has worked as advertised.

Maybe you like the way it works. I find it useless, because it does
exactly the opposite of what I would want it to do (but I know that
that's impossible).

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"