Re: BEGIN WORK READ ONLY; - Mailing list pgsql-general

From Tom Lane
Subject Re: BEGIN WORK READ ONLY;
Date
Msg-id 10801.1160852642@sss.pgh.pa.us
Whole thread Raw
In response to BEGIN WORK READ ONLY;  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: BEGIN WORK READ ONLY;  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-general
"Joshua D. Drake" <jd@commandprompt.com> writes:
> What is the use case for a READ ONLY transaction?

> I haven't been able to come up with a good answer. Anyone got a use case
> for this feature? I know the community didn't implement it for giggles.

No, we implemented it because it's required by the SQL spec.

I'm not too sure about use-cases either.  It certainly seems pretty
useless from a protection standpoint.  It might be that some other
DBMSes like to know about READ ONLY so they can optimize transaction
processing, but Postgres doesn't care.  (We do the equivalent optimization
by noting at COMMIT time whether you actually made any DB changes,
which we can determine basically for free by seeing if the xact emitted
any WAL records ...)

            regards, tom lane

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: BEGIN WORK READ ONLY;
Next
From: "Joshua D. Drake"
Date:
Subject: Re: BEGIN WORK READ ONLY;