Re: obtain the difference between successive rows

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: obtain the difference between successive rows
Date: 2012-10-20 16:41:38
Message-ID: CAPTjJmqP4JvHsKbyBZ+=iFN09DFVkpr6wsnzW8oHhRAs-JQEbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Oct 21, 2012 at 3:29 AM, Raymond O'Donnell <rod(at)iol(dot)ie> wrote:
> On 20/10/2012 17:23, Tom Lane wrote:
>> Having said that, they are pretty expensive. I tend to agree that doing
>> the processing on the application side might be faster --- but only if
>> you've got a place to put such code there. If you've just got generic
>
> True, assuming that you're working with a language that handles dates
> well... I do a lot of PHP, and have found that it's generally safer to
> handle date arithmetic in Postges.

That's because PHP is a sucky language :)

For a job like this, I'd probably whip up something in Pike. Excellent
string handling, easy database access (including an efficient
implementation of the pgsql protocol - skips the usual underlying
library and talks directly to the server), and the best Unicode
support I've seen in any application language (now equalled by Python,
as of version 3.3 that just came out). Biggest downside is that it's a
tad obscure.

object db=Sql.Sql("pgsql://username:password(at)hostname/database");
db->query("select blah from blah");

ChrisA

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-10-20 16:50:50 Re: obtain the difference between successive rows
Previous Message Berend Tober 2012-10-20 16:35:55 Re: obtain the difference between successive rows