Re: Temporary table already exists

Поиск
Список
Период
Сортировка
Искать
От
Adrian Klaver
Тема
Re: Temporary table already exists
Дата
Msg-id
52F3820D.6070104@gmail.com
Ответ на
Список
Дерево обсуждения
Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Temporary table already exists Dmitriy Igrishin <dmitigr@gmail.com>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Adrian Klaver <adrian.klaver@gmail.com>
Re: Temporary table already exists Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Adrian Klaver <adrian.klaver@gmail.com>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Adrian Klaver <adrian.klaver@gmail.com>
Re: Temporary table already exists Mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Adrian Klaver <adrian.klaver@gmail.com>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists alexandros_e <alexandros.ef@gmail.com>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
Re: Temporary table already exists Adrian Klaver <adrian.klaver@gmail.com>
Re: Temporary table already exists Alban Hertroys <haramrae@gmail.com>
Re: Temporary table already exists "Felix Kunde" <felix-kunde@gmx.de>
Re: Temporary table already exists mephysto <mephystoonhell@gmail.com>
On 02/06/2014 12:09 AM, mephysto wrote:
> Hi Adrian,
> it is not an artifact. This log comes from a multiplayer game, and this
> is an specific test to replicate the error. Practically, there are two
> users that execute the same operation, so you can see the simultaneous
> selects.
>
> My opinion was every session was isolated from others and temporary
> table was atomic for every session (transaction).

Well sessions and transactions are not the same thing. A  simple 
explanation:

A session is a specific connection to a database.

A transaction is a unit of work. It can be explicitly bounded by 
BEGIN/COMMIT(ROLLBACK). In Postgres if you do not supply the BEGIN each 
statement gets one, so each statement is in a transaction.

So a session can have one transaction or multiple.

>
> But I think that I'm not true.
>
> Are The two selects in the same session in my case? Why?

The issue to me at least, assuming Postgres is working properly, is that 
you have two selects in the same transaction. The ON COMMIT DROP should 
drop the table at the end of the transaction. Now as Alban wrote it is 
possible that the table is being cached somehow. One suggestion I on 
that line of thought is to use dynamic commands:

http://www.postgresql.org/docs/9.2/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

It is also possible, as mentioned previously, that the Java code is 
misbehaving. That there are threads interfering with each other. I am 
not a Java programmer so I can not be of any help there.

>
> Thanks in advance.
>
> Mephysto
>
>
>

-- 
Adrian Klaver
adrian.klaver@gmail.com

В списке pgsql-general по дате отправления
От: Adrian Klaver
Дата:
От: Rémi Cura
Дата:
FAQ