Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17D214F4@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns  ("Andrus" <kobruleht2@hot.ee>)
Список 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 по дате отправления:

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: String concatenation operator which keeps trailing spaces in CHAR(n) columns
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: pgbouncer not finding pidfile