Postgresql - Currval Vs Session Pool

Поиск
Список
Период
Сортировка
От Gustavo Amarilla Santacruz
Тема Postgresql - Currval Vs Session Pool
Дата
Msg-id CAKc1ktUJy=gazYN-PwR8O9xzoEsfS5i1_YfKFbHP+qyHp=LJwQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Postgresql - Currval Vs Session Pool  (David Johnston <polobo@yahoo.com>)
Re: Postgresql - Currval Vs Session Pool  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Re: Postgresql - Currval Vs Session Pool  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Hello, all.

In the PostgreSQL documentation I found "currval: Return the value most recently obtained by nextval for this sequence in the current session ...."

In other documentations (pgpool, for example), I found "Connection Pooling
pgpool-II saves connections to the PostgreSQL servers, and reuse them whenever a new connection with the same properties (i.e. username, database, protocol version) comes in. It reduces connection overhead, and improves system's overall throughput"

Then, I have the following question: PostgreSQL differentiates between sessions created for the same user?

Background
==========
- I, traditionalmente, have several user in a web application (user table, for example); but I use only one postgresql-db-user to get connetions to database

- If a CREATE (CRUD) operation uses a head-detail couple of tables, then in a transaction: data in HEAD table is inserted; next, the value for the primary key is achieved from currval function; next references to head table is inserted in detail table.


Other questions
===============
- If I use a "bd_user" user to get connections to PostgreSQL and I use connetions Pool; if CONNECTION_01 and CONNECTION_02 concurrently  try to get value from "currval" function, what happens?

- Exist best practices to do what I trying.


Thank you, in advance.


------------------------
Gustavo Amarilla

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

Предыдущее
От: dinesh kumar
Дата:
Сообщение: Re: Postgres 8.4 stopped working---Please urgent help needed
Следующее
От: David Johnston
Дата:
Сообщение: Re: Postgresql - Currval Vs Session Pool