dbTalk Databases Forums  

Re: [BUGS] BUG #1313: problems with array syntax parsing in SQL

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #1313: problems with array syntax parsing in SQL in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe Conway
 
Posts: n/a

Default Re: [BUGS] BUG #1313: problems with array syntax parsing in SQL - 11-12-2004 , 10:58 AM






PostgreSQL Bugs List wrote:
Quote:
In INSERT statements the string '{}' is correctly parsed as an empty array
when '{ }' is not, as if the space was signifiant, and generates a syntax
error.

Also
'{"A", "B"}' will be correctly parsed when
'{"A", "B" }' (note the space before the closing brace ) will generate the
following entry '{"A","B "} : the space(s) between the latest double quote
and the closing brace is/are added to the latest item of the array.

Fixed in cvs:

regression=# select version();
version
----------------------------------------------------------------------------
PostgreSQL 8.0.0beta4 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
(1 row)

regression=# create table test(f1 text[]);
CREATE TABLE
regression=# insert into test values ('{"A", "B" }');
INSERT 155428 1
regression=# select * from test;
f1
-------
{A,B}
(1 row)

regression=# insert into test values ('{ }');
INSERT 155429 1
regression=# select * from test;
f1
-------
{A,B}
{}
(2 rows)

Joe


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.