Re: Locking question

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Locking question
Дата
Msg-id CACjxUsO6W0LQa6ULDdBAshQ2d2jxX9OYX7C-hUyZ_+S9Ks+uUw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Locking question  ("Frank Millman" <frank@chagford.com>)
Список pgsql-general
On Thu, Oct 27, 2016 at 1:37 AM, Frank Millman <frank@chagford.com> wrote:

> As mentioned previously, I am trying to avoid using PostgreSQL-specific
> techniques, as I need to support sqlite3 and SQL Server as well.

The SERIALIZABLE transaction isolation level is portable.  It it
part of the SQL standard (and has been since the beginning), and is
supported by just about every database product, including SQLite
and SQL Server.  (In fact, you have to go well out of your way for
SQLite transactions *not* to be SERIALIZABLE --
https://www.sqlite.org/isolation.html )

> For costing purposes, I want to run a FIFO system. This means I have to
> maintain separate entries for each receipt of stock, and allocate any sales
> of stock against the receipts ‘oldest first’.

The two ways of doing this which spring to mind are window
functions (supported by PostgreSQL and SQL Server, but not SQLite)
and cursors (supported by most database products, including the
three you mention).

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: "Jaisingkar, Piyush"
Дата:
Сообщение: Re: Passing NULL values in dblink function call
Следующее
От: Joanna Xu
Дата:
Сообщение: Re: Remove Standby (SLAVE) from Primary (MASTER) - Postgres9.1