Skip site navigation (1) Skip section navigation (2)

Re: Strange interval arithmetic

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange interval arithmetic
Date: 2005-11-30 22:18:23
Message-ID: 20051130221823.GA27181@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Wed, Nov 30, 2005 at 07:06:42PM -0300, Alvaro Herrera wrote:
> Hmm, why not check both the return value _and_ errno:
> 
> val = strtol(field[i], &cp, 10);
> if (val == LONG_MAX && errno == ERANGE)
> 	return DTERR_FIELD_OVERFLOW;

I usually check both in my own code but I noticed several places
where PostgreSQL doesn't, so I kept that style.  I'll check both
if that's preferred.

-- 
Michael Fuhr

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-11-30 22:20:54
Subject: Re: Strange interval arithmetic
Previous:From: Alvaro HerreraDate: 2005-11-30 22:06:42
Subject: Re: Strange interval arithmetic

pgsql-patches by date

Next:From: Tom LaneDate: 2005-11-30 22:20:54
Subject: Re: Strange interval arithmetic
Previous:From: Alvaro HerreraDate: 2005-11-30 22:06:42
Subject: Re: Strange interval arithmetic

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group