Re: A thread about SPs -- mentioning PostgreSQL - Mailing list pgsql-advocacy

From Josh Berkus
Subject Re: A thread about SPs -- mentioning PostgreSQL
Date
Msg-id 200408010948.26417.josh@agliodbs.com
Whole thread Raw
In response to Re: A thread about SPs -- mentioning PostgreSQL  ("Fred Moyer" <fred@redhotpenguin.com>)
Responses Re: A thread about SPs -- mentioning PostgreSQL
List pgsql-advocacy
Fred,

> So being both a programmer and dba, with a database like PostgreSQL which
> has procedural languages in several different flavors, I am wondering what
> else besides robust transactions PostgreSQL stored procedures provides?
> (that in itself is enough for me)  Achieving transactions on the
> application side has it's caveats, which is why I am keen on using
> PostgreSQL's transactional API for data (read object) persistence.

Sure:

1) More efficient set operations: server-side stuff tends to do this better,
being closer to the database.

2) "Ironclad" business rules:  by attaching an Constraint, Data-push Function,
Trigger or Rule to a table you make it impossible to break that Business
Rule.  If the BR is in the mod_perl code, you're depending on your interface
developer's consistency, which can lead to mistakes.

3) "Virtual Tables":  You can use set-returning functions to return rowsets
that would be difficult to get efficiently out of a view, such as queries
containing "dummy rows" or complex orderings.

> I spend the bulk of my time right now coding mod_perl, so I ask you
> pgsql-advocacy list, is pl/perl functionally equivalent to pl/pgsql?

Once the new one is out of beta, yes.  Your Testing Will Help (see the
PL/perlNG project).


--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-advocacy by date:

Previous
From: "Fred Moyer"
Date:
Subject: Re: A thread about SPs -- mentioning PostgreSQL
Next
From: Steve Bergman
Date:
Subject: New to PostgreSQL