Re: Temporary table already exists

Поиск
Список
Период
Сортировка
От alexandros_e
Тема Re: Temporary table already exists
Дата
Msg-id 1391675745070-5790806.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Temporary table already exists  (mephysto <mephystoonhell@gmail.com>)
Ответы Re: Temporary table already exists  (mephysto <mephystoonhell@gmail.com>)
Список pgsql-general
@mephysto I think you are trying to solve the wrong type of problem. Creation
of tables (temporary or not) are not supposed to run concurrently. So, this
is not an issue of PostgreSQL but design. There are two ways to solve the
problem.

a) You could use the sessionID (provided The Glassfish server) to create
unique names for the temporary table, if the temporary table is unique per
session. If not, since you are talking about multiplayer game the temporary
table name could include the userID, so it is unique per user. In that
sense, it could be persistent per user, or temporary depending on your
needs. In that case you will need EXECUTE command to CREATE the table in
your pgsql code, since the table name must be a variable in your functions.

b) I highly suspect that this temporary table is used for either caching or
local sorting / ordering. In this case Postgres is again the wrong tool. You
can use an embedded DB like SQLite, HSQLDB for the local database which may
be used for this type of operations, which 'syncs' to the global PostgreSQL
DB when connecting or disconnecting. Every client will have a separate copy
of this DB, so no overhead to the server.

Either way you will have solved your issue.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Temporary-table-already-exists-tp5789852p5790806.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: How to get rid of superfluous WAL segments?
Следующее
От: Rémi Cura
Дата:
Сообщение: Re: Ordering Results by a Supplied Order