Re: Why are stored procedures looked on so negatively?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Chris Travers <chris(dot)travers(at)gmail(dot)com>
Cc: Some Developer <someukdeveloper(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why are stored procedures looked on so negatively?
Date: 2013-08-02 13:18:35
Message-ID: CAHyXU0yRr=_k-aJj2pwETbt+yYZtpSwXeF4av_e_B-OwW28Kog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 2, 2013 at 1:49 AM, Chris Travers <chris(dot)travers(at)gmail(dot)com> wrote:
> Here's my $0.02
>
> Stored procedures have a bunch of problems historically. Part of this is
> because the interface traditionally is pretty spartan, and partly because
> some people take them too far.
>
> The first issue is that if you have a stored procedure which takes 2
> arguments and you need to extend it to three, then you have to change every
> call in the calling application. This can create a maintenance problem.
> Variadic functions help somewhat but there are limits to what a variadic
> function can do here.

This is true of most popular languages. The other defenses are
default arguments (use very sparingly), overloading, and named
parameter arguments. If you're writing library routines that need to
accommodate a lot of behaviors, named arguments + use of defaults is a
pretty neat way to go.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-08-02 13:48:27 Re: Add a NOT NULL column with default only during add
Previous Message Tim Bowden 2013-08-02 11:34:55 Installing 9.2 on Ubuntu from packages: what is the current recommendation?