Skip site navigation (1) Skip section navigation (2)

Re: Reason(s) not to use a stored procedure

From: Ilan Volow <listboy(at)clarux(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Reason(s) not to use a stored procedure
Date: 2008-01-22 17:19:18
Message-ID: CB8D64CD-09E2-44EC-B737-025C214D8591@clarux.com (view raw or flat)
Thread:
Lists: pgsql-novice
IMHO, like most everything dealing with any kind of software  
development, it's an engineering tradeoff.

When I write plpgsql stored procedures, I am trading:

	- Easy portability between databases  (to the extent that SQL is  
portable between databases)

	- Niceties like IDE's with useful IDE stuff like being able to  
search through code  (I had to write a custom application to do this  
with plpgsql).

	- Ease of SCM  (I am having to write a custom application to do this  
with plpgsql)

	- Ease of debugging  (via using a real debugger, that I have to do  
absolutely no work at all to install and that I don't have to buy)

	- Maintainability. I personally find maintaining large bunches of  
plpgsql to be a major PITA. Code can easily get lost if you restore a  
dump in the wrong way.

	- A good, clean separation between application layers and storage  
layers

for:

	- Using loops and variables so I don't  have to write and debug a  
cluster**** of SQL spaghetti.

	- Avoiding getting involved with introducing a separate middle-ware  
server.

	- Not having to change the Objective-C code for my rich-client,   
recompile it, and redeploy it to get the change in behavior I want.  
Updates are instantaneous and centralized.


Probably not the stuff that your professor mentioned, but it's what's  
been my experience. Other experiences may vary.


On Jan 22, 2008, at 8:49 AM, Mag Gam wrote:

> I was in an academic meeting where a professor was preaching the  
> reasons why not to use a stored procedure. He advised to always use  
> SQL instead of a procedural language. Can someone please shed some  
> light on this?
>
> THANKS
>

Ilan Volow
"Implicit code is inherently evil, and here's the reason why:"



In response to

pgsql-novice by date

Next:From: Andrew WinklerDate: 2008-01-22 18:31:58
Subject: Re: Reason(s) not to use a stored procedure
Previous:From: Jonah H. HarrisDate: 2008-01-22 15:33:21
Subject: Re: Reason(s) not to use a stored procedure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group