Re: || versus concat( ), diff behavior - Mailing list pgsql-general

From Tom Lane
Subject Re: || versus concat( ), diff behavior
Date
Msg-id 1914.1330891905@sss.pgh.pa.us
Whole thread Raw
In response to Re: || versus concat( ), diff behavior  (c k <shreeseva.learning@gmail.com>)
List pgsql-general
c k <shreeseva.learning@gmail.com> 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, stop using char(n); it's a badly
defined data type, and there are almost no cases where varchar or text
isn't preferable.

            regards, tom lane

pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Return unknown resultset from a function
Next
From: Rory Campbell-Lange
Date:
Subject: Re: Return unknown resultset from a function