Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e6VL60B29510 for ; Mon, 31 Jul 2000 17:06:01 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id RAA13675; Mon, 31 Jul 2000 17:05:57 -0400 (EDT) To: "Sandis" cc: pgsql-sql@postgresql.org Subject: Re: Simple concatenation in select query 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> Comments: In-reply-to "Sandis" message dated "Mon, 31 Jul 2000 22:48:16 +0300" Date: Mon, 31 Jul 2000 17:05:57 -0400 Message-ID: <13672.965077557@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/290 "Sandis" 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