Re: PL/Perl returning multiple rows

From: Christopher Murtagh <christopher(dot)murtagh(at)mcgill(dot)ca>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "'PostgreSQL General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/Perl returning multiple rows
Date: 2003-11-11 03:57:11
Message-ID: 1068523030.13572.45.camel@mafalda.murtagh.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2003-11-10 at 21:11, Joshua D. Drake wrote:
> The fact that it is pl/pgSQL? Seriously though, I think that pl/pgSQL is
> counter intuitive to some people and those of us who are coming from say a Perl
> background are going to be much more proficient in using pl/Perl then having
> to learn YET another language.

Thanks for all the feedback. I've written a bunch of triggers in
pl/pgsql and it wasn't the worst thing. The reason why I was thinking
pl/perl is because my perl function needs to make a system call (to
htDig actually) and extract integers from URLs that htDig give it.

I know I could write this in Perl with my eyes closed, but I'm not so
sure how I would do this with pgSQL. Can you even make pl/pgSQL
'untrusted' to make syscalls?

Basically, what I'm doing is using htDig to index and search text
objects within Postgres. I spent a lot of time trying to get GiST and
tsearch to work, but the lack of documentation and complexity of it made
it impossible. Plus, htDig already has features that allow it to ignore
HTML, phrase searching as well as fuzzy logic for lexemes, soudex and
whatnot. We donated a G4 (and hopefully more soon) to the htDig team to
help get 3.2 out of beta, and it is paying off big time. Here's a
prototype of one component of the search engine:

http://newfind.mcgill.ca/ads/

which basically is an index of:

http://www.mcgill.ca/classified/

That search tool works well, but it is a PHP wrapper/hack. I would much
rather do it at the DB level rather than PHP as it makes it a much more
powerful tool. If I had a month or two, I would take the htDig source
and make it a Postgres plugin, but unfortunately I don't.

The worst part of this is that I have about two days to finish building
this. :-(

So, perhaps I should stick with Perl for now, and hope that with a real
SPI, the speed will improve significantly. Someone mentioned earlier
that there is an experimental SPI... just how experimental exactly?
Segfault and die or less dangerous?

Thanks again for all the feedback. I'd be happy for any more thoughts
and ideas.

Cheers,

Chris
--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2003-11-11 04:05:58 Re: PL/Perl returning multiple rows
Previous Message Rajesh Kumar Mallah 2003-11-11 03:19:37 Re: Questions from a beginner!