Re: obtain the difference between successive rows - Mailing list pgsql-general

From Chris Angelico
Subject Re: obtain the difference between successive rows
Date
Msg-id CAPTjJmqP4JvHsKbyBZ+=iFN09DFVkpr6wsnzW8oHhRAs-JQEbQ@mail.gmail.com
Whole thread Raw
In response to Re: obtain the difference between successive rows  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
On Sun, Oct 21, 2012 at 3:29 AM, Raymond O'Donnell <rod@iol.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@hostname/database");
db->query("select blah from blah");

ChrisA


pgsql-general by date:

Previous
From: Berend Tober
Date:
Subject: Re: obtain the difference between successive rows
Next
From: Tom Lane
Date:
Subject: Re: obtain the difference between successive rows