Re: No sanity checking performed on binary TIME parameters. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: No sanity checking performed on binary TIME parameters.
Date
Msg-id 3206.1243263161@sss.pgh.pa.us
Whole thread Raw
In response to No sanity checking performed on binary TIME parameters.  (Andrew McNamara <andrewm@object-craft.com.au>)
Responses Re: No sanity checking performed on binary TIME parameters.  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Andrew McNamara <andrewm@object-craft.com.au> writes:
> When submitting a query via the V3 binary protocol (PQexecParams,  
> paramFormats[n]=1), it appears the PostgreSQL server performs no range  
> checking on the passed values.

A quick look at time_recv() shows this is true, and timetz_recv()
checks neither the time nor the zone component.

> Passing values greater than 24 hours  
> results in unpredictable results (dumps that cannot be restored,  
> strange output when printing the column in psql, etc).

I'm not entirely sure why we put a range limit on time values at all,
but given that we do, it'd probably be a good idea to check the range
in the recv functions.  I'm inclined to fix this for 8.4, but not
back-patch because of compatibility considerations.  Any objections
out there?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: generic options for explain
Next
From: Tom Lane
Date:
Subject: Re: generic options for explain