Should I use PL/PGSQL or Perl/PGSQL?

Started by Tyler MacDonaldabout 20 years ago4 messagesgeneral
Jump to latest
#1Tyler MacDonald
tyler@yi.org

I've been wondering, does anybody know which is more likely to be
installed on a postgresql server? Which is faster? I'm writting an
application in perl that is going to need to get broad information about
heiarchial data (how many parents, settings common on parents, etc), and I'd
like to put that data presentation logic into the database.

Thanks,
Tyler

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Tyler MacDonald (#1)
Re: Should I use PL/PGSQL or Perl/PGSQL?

On Fri, Feb 03, 2006 at 07:32:25PM -0800, Tyler MacDonald wrote:

I've been wondering, does anybody know which is more likely to be
installed on a postgresql server? Which is faster? I'm writting an
application in perl that is going to need to get broad information about
heiarchial data (how many parents, settings common on parents, etc), and I'd
like to put that data presentation logic into the database.

Well, plpgsql has been around for a long time whereas plperl is new so
at a guess the former will be much more common. Also, plpgsql is
installed by default on many systems whereas plperl is usually an
addon.

As for speed, no comment. Developer time is generally more important
anyway.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.

#3Merlin Moncure
mmoncure@gmail.com
In reply to: Tyler MacDonald (#1)
Re: Should I use PL/PGSQL or Perl/PGSQL?

On 2/3/06, Tyler MacDonald <tyler@yi.org> wrote:

I've been wondering, does anybody know which is more likely to be
installed on a postgresql server? Which is faster? I'm writting an
application in perl that is going to need to get broad information about
heiarchial data (how many parents, settings common on parents, etc), and I'd
like to put that data presentation logic into the database.

plpgsql.

for an explanation of my reasoning and a example of how to deal with
heiarchial data, check out my blog at
http://people.planetpostgresql.org/merlin/

#4Tyler MacDonald
tyler@yi.org
In reply to: Merlin Moncure (#3)
Re: Should I use PL/PGSQL or Perl/PGSQL?

Merlin Moncure <mmoncure@gmail.com> wrote:

On 2/3/06, Tyler MacDonald <tyler@yi.org> wrote:

I've been wondering, does anybody know which is more likely to be
installed on a postgresql server? Which is faster? I'm writting an
application in perl that is going to need to get broad information about
heiarchial data (how many parents, settings common on parents, etc), and I'd
like to put that data presentation logic into the database.

plpgsql.

for an explanation of my reasoning and a example of how to deal with
heiarchial data, check out my blog at
http://people.planetpostgresql.org/merlin/

Awesome, thanks! I'm using plpgsql now and am slowly getting
comfortable with it. I've attached my first draft of the recursive flag
setting finder; it works, but it's inefficient. I've got a postgres guru
here helping me out and I'll be sure to read over your article as well.

Cheers,
Tyler

Attachments:

222_aus_find_user_flags.sqltext/plain; charset=us-asciiDownload
223_aus_find_all_user_flags.sqltext/plain; charset=us-asciiDownload
224_aus_all_user_flag_set.sqltext/plain; charset=us-asciiDownload
225_aus_all_user_flags.sqltext/plain; charset=us-asciiDownload