Re: how to call sql code without function

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: how to call sql code without function
Дата
Msg-id dcc563d10708201103t743f17a2s9678b916a387c378@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to call sql code without function  ("Medi Montaseri" <montaseri@gmail.com>)
Список pgsql-admin
On 8/20/07, Medi Montaseri <montaseri@gmail.com> wrote:
> You can think of a database as a filesystem as well. That is do some
> processing, store the result in temp table, do some more, etc,etc then merge
> and process temp tables to arrive at some result.
>
> Just as in the case of filesystem, if you are operating in a concurrent
> evironment, you need to fence against that. That is it is possible that at a
> given time two sessions will arrive at the same processing point where they
> need to create such temp tables.

Each session will get it's own temp table, even if they have the same name.

The real issue is what they do with the data in that temp table to
make sure that they're committing changes that make sense given the
current state of data in the database.

> The other solution which I prefer is to write a stored procedure to solve
> this. Or get creative with nested and complex SQL queries.

Note that nested queries still have some race conditions (such as with
aggregate functions) in postgresql.

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

Предыдущее
От: "Medi Montaseri"
Дата:
Сообщение: Re: how to call sql code without function
Следующее
От: Erwin Brandstetter
Дата:
Сообщение: vacuumdb for a number of tables