Re: Re: [PATCHES] Patch to support transactions with BLOBs for current CVS

From: Denis Perchine <dyp(at)perchine(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCHES] Patch to support transactions with BLOBs for current CVS
Date: 2001-01-21 06:48:17
Message-ID: 01012112481700.00620@dyp.perchine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> > On Saturday 20 January 2001 10:05, you wrote:
> > > I just wanted to confirm that this patch was applied.
> >
> > Yes, it is. But the following patch is not applied. But I sure that it is
> > neccessary, otherwise we will get really strange errors (see discussion
> > in the thread).
> >
> > http://www.postgresql.org/mhonarc/pgsql-patches/2000-11/msg00013.html
>
> Can people comment on the following patch that Dennis says is needed?
> It prevents BLOB operations outside transactions. Dennis, can you
> explain why BLOB operations have to be done inside transactions?

If you forget to put BLOB in TX, you will get errors like 'lo_read: invalid
large obj descriptor (0)'. The problem is that in be-fsstubs.c in lo_commit
all descriptors are removed. And if you did not opened TX, it will be
commited after each function call. And for the next call there will be no
such fd in the tables.

Tom later wrote:
> I object strongly. As given, this would break lo_creat, lo_unlink,
> lo_import, and lo_export --- none of which need to be in a transaction
> block --- not to mention possibly causing gratuitous failures during
> lo_commit.

First of all it will not break lo_creat, lo_unlink for sure. But we can
remove checks from inv_create, and inv_drop. They are not important. At least
there will be no strange errors issued.

I do not know why do you think there will be any problems with lo_commit. I
can not find such reasons.

I can not say anything about lo_import/lo_export, as I do not know why they
are not inside TX themselves.

I am not sure, maybe Tom is right, and we should fix be-fsstubs.c instead.
But I do not see any reasons why we not put lo_import, and lo_export in TX.
At least this will prevent other backends from reading partially imported
BLOBs...

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp(at)perchine(dot)com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-01-21 07:08:07 Re: Re: [PATCHES] Patch to support transactions with BLOBs for current CVS
Previous Message Adriaan Joubert 2001-01-21 06:43:36 Re: BIT/BIT VARYING status

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-01-21 07:08:07 Re: Re: [PATCHES] Patch to support transactions with BLOBs for current CVS
Previous Message Bruce Momjian 2001-01-21 05:16:10 Fix for defaults in createuser