Re: Patch to check whether we are in TX when to lo_*

Поиск
Список
Период
Сортировка
От Denis Perchine
Тема Re: Patch to check whether we are in TX when to lo_*
Дата
Msg-id 00110323224400.00544@dyp.perchine.com
обсуждение исходный текст
Ответ на Re: Patch to check whether we are in TX when to lo_*  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
> > here is the patch attached which do check in each BLOB operation, if
> > we are in transaction, and raise an error otherwise. This will prevent
> > such mistakes.
>
> Hmm.  I'm not sure if this is a good idea, or just overprotective
> nannyism.  Comments anyone?
>
> As is, it's certainly undesirable because it will break backend
> lo_export and lo_import, neither of which need to be in an xact block.
> Perhaps that could be worked around somehow, but is it worth the
> trouble?

Hmmm... Actually you always should do BLOB operations in TX. I added this
check because some time ago I spent quite long time when I tried to figure
out what was wrong with my small test code. It successfully opens BLOB, but
then it complains about unknown fd. The reason was that I did this outside of
TX. After each command TX was automatically commited, and all fd's was
cleaned up. It is not so easy to detect such problem if you do not know the
code...

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

В списке pgsql-patches по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Inherited column patches
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Inherited column patches