Re: concatenation of strings

Поиск
Список
Период
Сортировка
От Joachim von Thadden
Тема Re: concatenation of strings
Дата
Msg-id 20020910124349.C3652@linux-ag.de
обсуждение исходный текст
Ответ на concatenation of strings  (Joachim von Thadden <j.thadden@linux-ag.de>)
Список pgsql-general
Here are the results of the tests below, so that you need not repeat
them. I use the newest version (7.2.2) of Postgres.

select proname,prorettype from pg_proc where proname='substr' or proname='right';

 proname | prorettype
---------+------------
 substr  |         25
 substr  |         25
 right   |         25
(3 Zeilen)

select typname from pg_type where typelem=25;

 typname
---------
 _text
(1 Zeile)

SELECT 'haha'||substr('jojo', 2);

 ?column?
----------
 hahaojo
(1 Zeile)

SELECT 'haha'||right('jojo', 2);

ERROR:  parser: parse error at or near "right"

SELECT 'haha'||cast(right('jojo', 2) AS text);

 ?column?
----------
 hahajo
(1 Zeile)

SELECT right('jojo', 2) || 'haha';

 ?column?
----------
 johaha
(1 Zeile)

Sincerely
    Joachim von Thadden

Am Die, Sep 10, 2002 at 12:37:39 +0000 schrieb Joachim von Thadden:
> Hi,
>
> I have a screwed problem with a simple string concatenation: If I concat
> a string with the result of a function, which is also a string, I get an
> error. If I do the same with a builtin function it works, also the
> return types are equal. Here is an example:
--
Joachim von Thadden            Linux Information Systems AG
Linux is our Business. ____________________________________ www.Linux-AG.com __

Linux-Trainings bundesweit - Termine unter http://www.linux-ag.com/training

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Joachim von Thadden
Дата:
Сообщение: concatenation of strings
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: concatenation of strings