Why READ ONLY transactions?

From: Christopher Browne <cbbrowne(at)libertyrms(dot)info>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, pgsql-advocacy(at)postgresql(dot)org
Subject: Why READ ONLY transactions?
Date: 2003-07-28 22:01:13
Message-ID: 60wue2tiom.fsf@dev6.int.libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-hackers pgsql-patches

Robert Treat wrote:
> On Sat, 2003-07-26 at 21:31, Gavin Sherry wrote:
>>>> - Read only transactions, bringing a greater level of security to web and
>>>> enterprise applications by protecting data from modification.

>> This should be removed. Even though I added it to the press release,
>> I've just realised it's not really a security measure against SQL
>> injection since injected code can just specify 'SET TRANSACTION READ
>> WRITE'. We should still mention it, but not as a security measure.

> Aside from spec compliance, whats the bonus for having it then? Or put
> a better way, why/when would I want to use this?

If I am writing a "report program" that isn't supposed to do any
updates to anything, then I would be quite happy to set things to
READ-ONLY as it means that I won't _accidentally_ do updates.

It's like adding a pair of suspenders to your wardrobe. You can
_always_, if you really try, get your pants to fall down, but this
provides some protection.

I would NOT call it a "security" provision, as it is fairly easily
defeated using SET TRANSACTION.

But it's a nice discipline...

We can tell people:

"When you are writing report programs, start them off by setting
transactions to be READ-ONLY. That means that you won't modify data
by accident."

That's a useful sort of "Best Practice," for those organizations that
are into that sort of thing.
--
let name="cbbrowne" and tld="libertyrms.info" in name ^ "@" ^ tld;;
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 646 3304 x124 (land)

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Gavin Sherry 2003-07-28 23:16:59 Re: 7.4 Press Release -- Draft #4
Previous Message Josh Berkus 2003-07-28 20:56:59 Re: 7.4 Press Release -- Draft #4

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-07-28 22:35:35 Re: Regression test failure date.
Previous Message Merlin Moncure 2003-07-28 21:21:45 an aggregate array function

Browse pgsql-patches by date

  From Date Subject
Next Message Andreas Haumer 2003-07-29 08:15:14 pgsql-7.3.3: Build process not SMP clean
Previous Message Serguei A. Mokhov 2003-07-28 21:56:03 [pgsql-rus] Russian NLS update: pg_dump, libpq, pg_controldata, pg_resetxlog, pgscripts (fwd)