Re: Concept about stored procedures

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Marcos <marcos(at)auriance(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Concept about stored procedures
Date: 2006-01-13 20:29:21
Message-ID: 20060113202921.GN9017@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Using stored procedures as an API to the database is a perfectly
acceptable way of doing things, and provides some nice benefits:

You can lock out all other access to tables. This limits what can be
done if the application gets compromised.

It means you don't have to worry about people embedding SQL into the
bowels of the application.

It provides a well-defined API into the database.

As an added bonus, in 8.1 there is syntax checking done on
functions when they are created. This makes catching bugs much easier...
previously you'd have to actually run the code to see if there were any
syntax errors. Now, if you use functions, syntax errors will be found as
soon as you load the code into the database. This feature alone makes
using stored procs as an API worth it.

On Wed, Jan 11, 2006 at 05:13:01PM +0000, Marcos wrote:
> Hi,
>
> I'm developing one application using this wonderful Database, and I've
> like of use the concepts correctly.
>
> Then, i decided that all my SQL statements will be in database using the
> procedure language (plpgsql or plpython), I go create functions for all
> interactions in database, and use in the my application the SELECT for
> call him.
>
> Is its the correct way of working? Or the correct way is create
> procedure functions for big and complex statements?
>
> The application will work with a large Database and will have many
> simultaneous access.
>
> Very Thanks!!!!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-13 20:44:19 Re: Create Produre for DROP row
Previous Message David Fetter 2006-01-13 20:25:01 Re: PostgreSQL Top 10 Wishlist