pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Bertheau <twanger@bluetwanger.de>
To: Joe Conway <mail@joeconway.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Patches (PostgreSQL) <pgsql-patches@postgresql.org>
Subject: Re: [SQL] array_in: '{}}'::text[]
Date: Sat, 28 Aug 2004 22:09:20 +0200
Message-ID: <1093723759.2732.16.camel@teetnang> (raw)
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>

В Сбт, 28.08.2004, в 21:33, Joe Conway пишет:

>   	/* special case for an empty array */
> ! 	if (strcmp(str, "{}") == 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)));
> + 	}
> + 	
> + 	/* special case for an empty array */
> + 	if (empty_array)
> + 		return 0;

Here's the second special case for empty arrays.

-- 
Markus Bertheau <twanger@bluetwanger.de>




view thread (8+ messages)  latest in thread

Message-ID: <1093723759.2732.16.camel@teetnang>
Permalink:  ../1093723759.2732.16.camel@teetnang/
Also on:    postgresql.org/message-id/1093723759.2732.16.camel@teetnang

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: twanger@bluetwanger.de, mail@joeconway.com, tgl@sss.pgh.pa.us, pgsql-patches@postgresql.org
  Subject: Re: [SQL] array_in: '{}}'::text[]
  In-Reply-To: <1093723759.2732.16.camel@teetnang>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox