Re: [GENERAL] || versus concat( ), diff behavior

2012-03-04 Thread Tom Lane
c k writes: > what will be the reason for this? The short answer is that || uses cast-to-text semantics, whereas concat uses output-function semantics, and char(n) is one of the weird types for which those are different. Don't blame us, blame the SQL committee. Or rather than blaming anybody, st

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-04 Thread David Johnston
sage- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Philip Couling > Sent: Friday, March 02, 2012 4:47 PM > To: david.sahag...@emc.com > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] || versus concat( ), diff

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-04 Thread c k
lip Couling > Sent: Friday, March 02, 2012 4:47 PM > To: david.sahag...@emc.com > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] || versus concat( ), diff behavior > > On 02/03/12 20:58, david.sahag...@emc.com wrote: > > Can anybody please point me to where this "differe

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Philip Couling Sent: Friday, March 02, 2012 4:47 PM To: david.sahag...@emc.com Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] || versus concat( ), diff behavior On

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread Philip Couling
On 02/03/12 20:58, david.sahag...@emc.com wrote: Can anybody please point me to where this "difference of behavior" is explained/documented ? Thanks, -dvs- -- version = 9.1.3 do $$ declare v_str char(10); begin v_str := 'abc' ; raise info '%', concat(v_str, v_str) ; raise info '%',

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread Ben Chobot
On Mar 2, 2012, at 12:58 PM, wrote: > Can anybody please point me to where this "difference of behavior" is > explained/documented ? > Thanks, > -dvs- > > -- version = 9.1.3 > do $$ > declare > v_str char(10); > begin > v_str := 'abc' ; > raise info '%', concat(v_str, v_str) ; > raise info

[GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread david.sahagian
Can anybody please point me to where this "difference of behavior" is explained/documented ? Thanks, -dvs- -- version = 9.1.3 do $$ declare v_str char(10); begin v_str := 'abc' ; raise info '%', concat(v_str, v_str) ; raise info '%', v_str||v_str ; end $$; INFO: abc abc INFO: ab