pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Postgresql General <pgsql-general@postgresql.org>
Subject: different empty array syntax requirements
Date: Thu, 21 Apr 2016 20:20:13 -0600
Message-ID: <ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice







-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (5+ messages)  latest in thread

Message-ID: <ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com>
Permalink:  ../ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com/
Also on:    postgresql.org/message-id/ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: scott_ribe@elevated-dev.com
  Subject: Re: different empty array syntax requirements
  In-Reply-To: <ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com>
  References: <ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17@elevated-dev.com>

* 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