Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id AC934134A409 for ; Fri, 27 Apr 2012 11:22:27 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SNm41-0000dL-BK for pgsql-bugs@postgresql.org; Fri, 27 Apr 2012 14:22:26 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q3REMBio019560; Fri, 27 Apr 2012 10:22:11 -0400 (EDT) To: Ryan Kelly cc: Vik Reykja , pgsql-bugs@postgresql.org Subject: Re: hstore parser incorrectly handles malformed input In-reply-to: <20120427112235.GA9024@llserver.lakeliving.com> References: <20120426190513.GB31886@llserver.lakeliving.com> <12884.1335469833@sss.pgh.pa.us> <19224.1335489137@sss.pgh.pa.us> <20120427112235.GA9024@llserver.lakeliving.com> Comments: In-reply-to Ryan Kelly message dated "Fri, 27 Apr 2012 07:22:35 -0400" Date: Fri, 27 Apr 2012 10:22:11 -0400 Message-ID: <19559.1335536531@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/185 X-Sequence-Number: 32936 Ryan Kelly writes: > As long as we make it consistent on both sides of the '=>' (and document > it, too), then I don't really care either way. Currently you have to use > quotes to get an empty key, so I thought it natural to that you should > have to quote to get an empty value. > I've attached a modified version of Tom's patch which also allows empty > keys. Hm ... I don't agree that keys and values are interchangeable, and I don't see that empty keys are a good thing (whereas empty values are clearly a reasonable edge case). So I think this is going a bit far; it seems to me it'd be giving up a lot of syntax-error detection capability in return for some not-actually-helpful symmetry. On the other hand, I seldom use hstore so I'm probably not the best person to be judging the appropriateness of these options. Any other votes out there? regards, tom lane