different empty array syntax requirements

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: different empty array syntax requirements
Date: 2016-04-22 02:20:13
Message-ID: ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How is that one pgsql build (both are 9.5.2) has different casting behavior for empty arrays:

ericmj=# select ARRAY[]::text[];
array
-------
{}
(1 row)

ericmj=# select (ARRAY[])::text[];
array
-------
{}
(1 row)

--VS--

pedcard=# select ARRAY[]::text[];
array
-------
{}
(1 row)

pedcard=# select (ARRAY[])::text[];
ERROR: cannot determine type of empty array
LINE 1: select (ARRAY[])::text[];
^
HINT: Explicitly cast to the desired type, for example ARRAY[]::integer[].

--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Aguayo Garcia-Rada 2016-04-22 02:25:53 Re: different empty array syntax requirements
Previous Message david 2016-04-22 00:11:20 Re: Is it possible to call Postgres directly?