Re: [GENERAL] Surprising results from array concatenation

2017-04-25 Thread Mike Blackwell
On Tue, Apr 25, 2017 at 12:53 PM, Tom Lane wrote: > Yeah. The core problem here is that the parser has to disambiguate the > || operator: is it "anyarray || anyelement" or "anyarray || anyarray"? > ​<...>​ > Peeking at the contents of the literal would make the behavior

Re: [GENERAL] Surprising results from array concatenation

2017-04-25 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Apr 25, 2017 at 9:26 AM, Mike Blackwell > wrote: >> The docs (section 9.18 for PG 9.6) show as an example for array >> concatenation >> ARRAY[4,5,6] || 7 >> which works fine. However, trying the same with

Re: [GENERAL] Surprising results from array concatenation

2017-04-25 Thread David G. Johnston
On Tue, Apr 25, 2017 at 9:26 AM, Mike Blackwell wrote: > The docs (section 9.18 for PG 9.6) show as an example for array > concatenation > > ARRAY[4,5,6] || 7 > > which works fine. However, trying the same with an array of text doesn't > work: > > # select

[GENERAL] Surprising results from array concatenation

2017-04-25 Thread Mike Blackwell
The docs (section 9.18 for PG 9.6) show as an example for array concatenation ARRAY[4,5,6] || 7 which works fine. However, trying the same with an array of text doesn't work: # select array['a','b','c'] || 'd'; ERROR: malformed array literal: "d" LINE 1: select array['a','b','c'] || 'd';