pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sandis <sandis@mediaparks.lv>
Cc: pgsql-sql@postgresql.org
Subject: Re: Simple concatenation in select query
Date: Mon, 31 Jul 2000 17:05:57 -0400
Message-ID: <13672.965077557@sss.pgh.pa.us> (raw)
In-Reply-To: <008c01bffb28$457f56a0$d17b02c3@mediaparks.lv>
References: <87k8e78yg9.fsf@matt.w80.math-hat.com>
	<00072715082905.09700@comptechnews>
	<013001bff889$86051030$74b5f8c2@wkst6>
	<00072821505101.17801@comptechnews>
	<020f01bff95f$ac6bd2a0$74b5f8c2@wkst6>
	<008c01bffb28$457f56a0$d17b02c3@mediaparks.lv>

"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



view thread (4+ messages)  latest in thread

Message-ID: <13672.965077557@sss.pgh.pa.us>
Permalink:  ../13672.965077557@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13672.965077557@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sandis@mediaparks.lv
  Subject: Re: Simple concatenation in select query
  In-Reply-To: <13672.965077557@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox