hstore parser incorrectly handles malformed input - Mailing list pgsql-bugs

From Ryan Kelly
Subject hstore parser incorrectly handles malformed input
Date
Msg-id 20120426190513.GB31886@llserver.lakeliving.com
Whole thread Raw
Responses Re: hstore parser incorrectly handles malformed input  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
It seems that the hstore parser has some odd behavior in the the
handling of certain malformed input constructions:

[db]> select 'a=>,b=>1'::hstore;
    hstore
--------------
 "a"=>",b=>1"

[db]> select 'a=> ,b=>1'::hstore;
    hstore
--------------
 "a"=>",b=>1"

[db]> select 'a=>, b=>1'::hstore;
ERROR:  Syntax error near 'b' at position 5
LINE 2: select 'a=>, b=>1'::hstore;

In my mind, all of these should have been rejected as erroneous input.
To that end, I have attached a patch which causes all of these inputs
to be rejected as invalid.

-Ryan Kelly

Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: 291 pg_toast_temp schemas?
Next
From: Tom Lane
Date:
Subject: Re: hstore parser incorrectly handles malformed input