Simple concatenation in select query - Mailing list pgsql-sql

From Sandis
Subject Simple concatenation in select query
Date
Msg-id 008c01bffb28$457f56a0$d17b02c3@mediaparks.lv
Whole thread Raw
In response to Aggregates and Primary Keys  (Itai Zukerman <zukerman@math-hat.com>)
Responses Re: Simple concatenation in select query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hello,

Sorry for the stupid posting, but..

There was a string concatenation function in MySQL:
SELECT CONCAT(first_name, " ", last_name) FROM table;
Is there a similar function in Postgres?

Certainly, it's possible to live without it, but i'd like to write as above,
doing concatenation in place.

Ok, it seems i found it now:
SELECT TEXTCAT(first_name, last_name) FROM table;
but it allows only 2 arguments, inserting " " or ' ' (space) causes
an error: attribute ' ' not found! Why postgres doesnt see it as string?

Ok, i got it, after all! It took > 30 min to write this query.  :(
SELECT textcat(textcat(first_name,text ' '),last_name) from table;

It kind of strange, but i found this function not in "user manual",
but doing "\df text".. There is some differences between function
descriptions in manual and those that \df returns..
Virtually \df returns much more functions than in manual,
and there is some differences in argument types.

May be someone knows a better, complete manual with ALL
function described and code samples?

sandis@mediaparks.lv
www.mediaparks.lv




pgsql-sql by date:

Previous
From: Itai Zukerman
Date:
Subject: Re: Indices and time spans
Next
From: Henry Lafleur
Date:
Subject: RE: Simple concatenation in select query