X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 375145E46E1 for ; Sat, 28 Aug 2004 17:09:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61839-02 for ; Sat, 28 Aug 2004 20:09:28 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 101B85E46D4 for ; Sat, 28 Aug 2004 17:09:26 -0300 (ADT) Received: from [192.168.0.1] (dsl-082-082-193-241.arcor-ip.net [82.82.193.241]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id i7SK9I301224; Sat, 28 Aug 2004 22:09:18 +0200 Subject: Re: [SQL] array_in: '{}}'::text[] From: Markus Bertheau To: Joe Conway Cc: Tom Lane , "Patches (PostgreSQL)" In-Reply-To: <4130DE0F.7030207@joeconway.com> References: <1093261555.2647.6.camel@dicaprio.akademie1.de> <412A384C.5000907@joeconway.com> <412F9BA5.8070009@joeconway.com> <14978.1093662341@sss.pgh.pa.us> <4130DE0F.7030207@joeconway.com> Content-Type: text/plain; charset=UTF-8 Message-Id: <1093723759.2732.16.camel@teetnang> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Sat, 28 Aug 2004 22:09:20 +0200 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/524 X-Sequence-Number: 12813 =D0=92 =D0=A1=D0=B1=D1=82, 28.08.2004, =D0=B2 21:33, Joe Conway =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: > /* special case for an empty array */ > ! if (strcmp(str, "{}") =3D=3D 0) > return 0; Without looking at the code in a whole, you accept '{} ' as an empty array literal, so why is the special case for '{}' needed here? I should be catched by the code that accepts additional whitespace after the last closing brace, just that there is no white space: > + /* only whitespace is allowed after the closing brace */ > + while (*ptr) > + { > + if (!isspace(*ptr++)) > + ereport(ERROR, > + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), > + errmsg("malformed array literal: \"%s\"", str))); > + } > +=20=09 > + /* special case for an empty array */ > + if (empty_array) > + return 0; Here's the second special case for empty arrays. --=20 Markus Bertheau