Re: Simple concatenation in select query - Mailing list pgsql-sql

From Tom Lane
Subject Re: Simple concatenation in select query
Date
Msg-id 13672.965077557@sss.pgh.pa.us
Whole thread Raw
In response to Simple concatenation in select query  ("Sandis" <sandis@mediaparks.lv>)
List pgsql-sql
"Sandis" <sandis@mediaparks.lv> writes:
> 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's a lot easier if you use the SQL-standard concatenation operator:

regression=# select 'foo' || 'bar';?column?
----------foobar
(1 row)

textcat() just exists to implement the operator, which is why it's
not documented separately.

Dunno why you'd need to specify the type of the constant explicitly
in this context --- there is only one textcat function, so the system
ought to be able to figure it out.
        regards, tom lane


pgsql-sql by date:

Previous
From: Henry Lafleur
Date:
Subject: RE: Simple concatenation in select query
Next
From: Timothy Covell
Date:
Subject: What's ETA for read/write Views?