Re: Bug #491: ERROR: RelationClearRelation: relation using JDBC

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug #491: ERROR: RelationClearRelation: relation using JDBC
Дата
Msg-id 14600.1004028832@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Bug #491: ERROR: RelationClearRelation: relation using JDBC  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hmm.  This seems to be a slightly different variant of the problem than
the one we fixed.  You could avoid it by not letting your clients hold
open transactions while they're sitting idle.  The path that's causing
a problem (or at least the problem I reproduced here) is

    Backend 1            Backend 2

    use table users;

    commit; begin;

                    drop table users;

                    create new users table

    use table users;

The problem is essentially that backend 1 is prepared to notice the
old users table having gone away when it does "begin", but not later
in its transaction.  It's still trying to use its old cached relation
entry, which is for the now-deleted table.

This is a bug, agreed, but not one that I can easily back-patch a fix
for into 7.1.*.

Another possible workaround for you is to not drop and recreate the
users table.  Couldn't you just truncate it?

            regards, tom lane

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

Предыдущее
От: Martin Würtele
Дата:
Сообщение: postgres crash
Следующее
От: Bill Studenmund
Дата:
Сообщение: Re: Enabling --debug causes regression test failure.