possible array parsing bug

Started by Jeff Davisover 17 years ago2 messagesbugs
Jump to latest
#1Jeff Davis
pgsql@j-davis.com

This does not look right to me:

=# select regexp_split_to_array('dsf,sdfsdf',',')::text[][1000000];
regexp_split_to_array
-----------------------
{dsf,sdfsdf}
(1 row)

Is this known?

Regards,
Jeff Davis

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jeff Davis (#1)
Re: possible array parsing bug

Jeff Davis <pgsql@j-davis.com> writes:

This does not look right to me:

=# select regexp_split_to_array('dsf,sdfsdf',',')::text[][1000000];

Perhaps you meant to write

select (regexp_split_to_array('dsf,sdfsdf',',')::text[])[1000000];

As-is, the [100000] is just useless decoration on the cast's target
type name.

regards, tom lane