| From: | Neil Conway <neilc(at)samurai(dot)com> |
|---|---|
| To: | PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
| Subject: | numeric input changes |
| Date: | 2004-03-10 20:45:04 |
| Message-ID: | 87u10wsa7j.fsf@mailbox.samurai.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-patches |
The attached patch changes the rules for input to
int2/int4/int8/float4/float8 to consistently allow leading and
trailing whitespace in the input. This is for conformance with the
SQL standard, as discussed in an earlier -patches thread.
I also added a bunch more regression tests for the input format
accepted by these types.
I noticed one bug, or at least instance of bit rot: the float8 code
attempts to parse "Infinity" and "-Infinity" specially. Unfortunately,
this doesn't actually work:
nconway=# select 'Infinity'::float8;
ERROR: type "double precision" value out of range: overflow
nconway=# select '-Infinity'::float8;
ERROR: type "double precision" value out of range: overflow
I'm inclined to just remove this attempted functionality from the
code, rather than fix it to work properly. Any comments?
I intend to apply this patch tomorrow.
-Neil
| Attachment | Content-Type | Size |
|---|---|---|
| numeric_whitespace_input-4.patch | text/x-patch | 44.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2004-03-10 21:10:51 | Add non-blocking function to /port |
| Previous Message | Bruce Momjian | 2004-03-10 19:16:12 | Re: PSQLRC environment variable. |