Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns - Mailing list pgsql-general

From Albe Laurenz
Subject Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D214F4@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
Andrus wrote:
>> Use "bpchar" instead of "text" in the definition of function and operator.
>> Otherwise col1 gets cast to "text" and loses its trailing spaces.
> 
> Thank you very much.
> It worked.
> Which notation to use for this ?
> 
> Is it reasonable use "+" as such operator for strings or should some other
> notation used ?

The traditional concatenation operator name is ||, but I believe that it is
confusing to overwrite builtin operators.

You could use a name that does not show up in
SELECT DISTINCT oprname FROM pg_operator;

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns
Next
From: Adrian Klaver
Date:
Subject: Re: pgbouncer not finding pidfile