Thread: Re: skip weekends

Re: skip weekends

From
Rudi Starcevic
Date:
Hello,

Nice reply Josh.
I wouldn't call your solution 'ugly' at all.

It's an excellent example of a real world need for Postgresql functions.
I've also been looking at other functions at 
http://www.brasileiro.net/postgres/cookbook/.
I noticed your name amongst the author's -- nice one -- keep up the good 
work.
My only problem is trying to decide on whether to use PL/pgSQL or PLPerl.

Cheers
Rudi



Re: skip weekends

From
Cliff Wells
Date:
On Thu, 2002-06-20 at 23:08, Rudi Starcevic wrote:
> Hello,
> 
> Nice reply Josh.
> I wouldn't call your solution 'ugly' at all.
> 
> It's an excellent example of a real world need for Postgresql functions.
> I've also been looking at other functions at 
> http://www.brasileiro.net/postgres/cookbook/.
> I noticed your name amongst the author's -- nice one -- keep up the good 
> work.
> My only problem is trying to decide on whether to use PL/pgSQL or PLPerl.

You might also consider PL/Python.  I haven't used it, but I use Python
a lot outside of PG and it's an excellent language.

http://developer.postgresql.org/docs/postgres/plpython.html

Regards,
Cliff



Re: skip weekends

From
"Josh Berkus"
Date:
Rudi,

> Nice reply Josh.
> I wouldn't call your solution 'ugly' at all.

Actually I posed te question, and Joe Conway offered the solution.I'll be testing and reporting back.

> It's an excellent example of a real world need for Postgresql
> functions.
> I've also been looking at other functions at
> http://www.brasileiro.net/postgres/cookbook/.
> I noticed your name amongst the author's -- nice one -- keep up the
> good work.

Yes.  Sadly, Roberto seems to have lost interest in PostgreSQL, so the
cookbook is frozen.  <frown>  For example, There's a couple of bugs in
name_alike I'd like to fix, but I can't correct them and Roberto
doesn't answer his e-mail.   Anybody wanna take over the Cookbook?

> My only problem is trying to decide on whether to use PL/pgSQL or
> PLPerl.

Use them both.  PL/Perl is better at text parsing, loops and arrays.PL/pgSQL is faster for data operations.  Use the
besttool for the
 
job!

One thing I'd love to see is a generic address tokenizer, so that I can
write an "address_alike" function.   My Perl isn't up to it.

Heck, a generic string tokenizer would be even more useful.  Can a
PL/Perl function return an array?

-Josh