Re: Writing most code in Stored Procedures

Поиск
Список
Период
Сортировка
От Trevor Talbot
Тема Re: Writing most code in Stored Procedures
Дата
Msg-id 90bce5730708151824t74a5f3b2s61032656673d8e1c@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Writing most code in Stored Procedures  (Steve Manes <smanes@magpie.com>)
Ответы Re: Writing most code in Stored Procedures
Список pgsql-general
On 8/15/07, Steve Manes <smanes@magpie.com> wrote:

> I'm fairly hardcore about keeping as much business logic as I can in the
> database.  In fact, I only do SELECTs from the application, and usually
> via Views.  All inserts, updates and deletes are via procs.  I'm a
> proponent of separating application code from presentation and
> application code from database code.  And HTML from layout style, for
> that matter.
>
> In addition to the other reasons you've gotten:

> Another is because I want transactions to start and end in the database,
> not in external application code which might crash before a COMMIT.

Hmm, how do you handle this logically?  Do your applications never
need to submit chunks of work at once?  Or do you do something like
fill in a temporary table, and have a proc work from that?

> Another is because I'm a freelancer and generally hand off my
> applications to the client's tech department, which is often a junior
> level grasshopper who knows just enough SQL to be dangerous. Using
> stored procedures raises the bar on what they need to know about RDMBSes
>   before they start hacking working code.

...although that helps explain "why" a bit more: if you're stuck with
people who can't use transactions properly, it makes sense to keep
them out of reach...

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

Предыдущее
От: "Phoenix Kiula"
Дата:
Сообщение: Re: pg_dump on local Windows, pg_restore on Linux?
Следующее
От: "서기석"
Дата:
Сообщение: please! SPI_finish is strange