[PATCH] bugfix for int2vectorin
Caleb Welton <cwelton@greenplum.com>
From: Caleb Welton <cwelton@greenplum.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2009-12-02T02:36:05Z
Lists: pgsql-hackers
Attachments
- int2vector.patch (application/octet-stream) patch
I believe the int2vectorin function should handle invalid input more cleanly. Current behavior: -- Correct input format: SELECT '1 2 3'::int2vector; int2vector ------------ 1 2 3 (1 row) -- Three variations on incorrect input format SELECT '1not 2really_an 3int2vector'::int2vector; int2vector ------------ 1 2 3 (1 row) SELECT '1,2,3'::int2vector; int2vector ------------ 1 (1 row) SELECT '1, 2,3'::int2vector; int2vector ------------ 1 2 (1 row) -- What other types do: SELECT '1,2'::oid; ERROR: invalid input syntax for type oid: "1,2" Behavior after attached patch: -- Correct input format: SELECT '1 2 3'::int2vector; int2vector ------------ 1 2 3 (1 row) -- Three variations on incorrect input format SELECT '1not 2really_an 3int2vector'::int2vector; ERROR: invalid input for int2vector: "1not 2really_an 3int2vector" SELECT '1,2,3'::int2vector; ERROR: invalid input for int2vector: "1,2,3" SELECT '1, 2,3'::int2vector; ERROR: invalid input for int2vector: "1, 2,3" -- What other types do: SELECT '1,2'::oid; ERROR: invalid input syntax for type oid: "1,2" Regards, Caleb