Re: Why are stored procedures looked on so negatively?

Поиск
Список
Период
Сортировка
Искать
От
Luca Ferrari
Тема
Re: Why are stored procedures looked on so negatively?
Дата
Msg-id
CAKoxK+44vLm+6U1=EJ+1wUJvKfbznswVS6tyhRbOuEjHUJEsTA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? "Gauthier, Dave" <dave.gauthier@intel.com>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? Adrian Klaver <adrian.klaver@gmail.com>
Re: Why are stored procedures looked on so negatively? Merlin Moncure <mmoncure@gmail.com>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? hidayat365@gmail.com
Re: Why are stored procedures looked on so negatively? Neil Tiffin <neilt@neiltiffin.com>
Re: Why are stored procedures looked on so negatively? Kevin Grittner <kgrittn@ymail.com>
Re: Why are stored procedures looked on so negatively? Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Why are stored procedures looked on so negatively? Adrian Klaver <adrian.klaver@gmail.com>
Re: Why are stored procedures looked on so negatively? John Meyer <johnmeyer@pueblocomputing.com>
Re: Why are stored procedures looked on so negatively? Andrew Sullivan <ajs@crankycanuck.ca>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Why are stored procedures looked on so negatively? Kevin Goess <kgoess@bepress.com>
Re: Why are stored procedures looked on so negatively? Bèrto ëd Sèra <berto.d.sera@gmail.com>
Re: Why are stored procedures looked on so negatively? Aaron Abreu <abreual@bay.k12.fl.us>
Re: Why are stored procedures looked on so negatively? Vincenzo Romano <vincenzo.romano@notorand.it>
Re: Why are stored procedures looked on so negatively? Vincenzo Romano <vincenzo.romano@notorand.it>
Re: Why are stored procedures looked on so negatively? Merlin Moncure <mmoncure@gmail.com>
Re: Why are stored procedures looked on so negatively? Luca Ferrari <fluca1978@infinito.it>
Re: Why are stored procedures looked on so negatively? Chris Travers <chris.travers@gmail.com>
Re: Why are stored procedures looked on so negatively? Merlin Moncure <mmoncure@gmail.com>
Re: Why are stored procedures looked on so negatively? Craig Ringer <craig@2ndquadrant.com>
Re: Why are stored procedures looked on so negatively? Chris Travers <chris.travers@gmail.com>
Re: Why are stored procedures looked on so negatively? Jeff Janes <jeff.janes@gmail.com>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? Luca Ferrari <fluca1978@infinito.it>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? Sébastien Lorion <sl@thestrangefactory.com>
Re: Why are stored procedures looked on so negatively? Vincenzo Romano <vincenzo.romano@notorand.it>
Re: Why are stored procedures looked on so negatively? Some Developer <someukdeveloper@gmail.com>
Re: Why are stored procedures looked on so negatively? Steve Atkins <steve@blighty.com>
Re: Why are stored procedures looked on so negatively? Pavel Stehule <pavel.stehule@gmail.com>
Re: Why are stored procedures looked on so negatively? "Gauthier, Dave" <dave.gauthier@intel.com>
Re: Why are stored procedures looked on so negatively? Bèrto ëd Sèra <berto.d.sera@gmail.com>
Re: Why are stored procedures looked on so negatively? V S P <toreason@fastmail.fm>
Re: Why are stored procedures looked on so negatively? Pavel Stehule <pavel.stehule@gmail.com>
On Wed, Jul 24, 2013 at 2:29 AM, Some Developer
 wrote:
> I've done quite a bit of reading on stored procedures recently and the
> consensus seems to be that you shouldn't use them unless you really must.

I believe because most developers are not DBAs, and therefore are
scared about something they cannot control.
Placing as much logic as possible in the database is, in my opinion,
good since it will prevent any accidental (?) connection to the
database to corrupt your data. By accidental connection I mean a
developer/dba connecting to the database to change some value and
corrupting some constraint (that reside in the application) or by an
aside application or a refactoring of the application (e.g., in order
to change the application technology).
Thanks to the PostgreSQL support to many pl languages, you can even
reuse some existing application logic into the database, but it does
not mean this is the smarter choice (performance? OOP vs procedural?).
Of course, as placing business logic into the database makes the
database "code" more complex, it is required to do unit testing on the
code itself (e.g. pgtap).
Finally, another point in being "scared" of using stored procedure is
portability: a lot of frameworks claim to be portable across database
because they use a minimal survival subset of SQL features that are
almost supported on any decent database. Using a stored procedure will
make more complex the portability, since pl procedures need to be
translated from one database to another.

Luca

В списке pgsql-general по дате отправления
От: Amit Langote
Дата:
От: Giuseppe Broccolo
Дата:
FAQ