concatenating two text attributes - Mailing list pgsql-general

From Karl DeBisschop
Subject concatenating two text attributes
Date
Msg-id 199912061655.LAA19285@skillet.infoplease.com
Whole thread Raw
List pgsql-general
I'd like to do something like

    SELECT strcat(foo,bar) FROM test;

or

    SELECT foo+bar FROM test;

where test is

CREATE TABLE test (foo char(20), bar char(20));
INSERT INTO test (foo,bar) VALUES ('foo','bar');

Of course it seems like it'd be easy enough to write a PL/TCL funcion
to do this (or pick your favorite PL here).  But before I do that I'd
just like to check if PostgreSQL (or generic SQL for that matter)
provides a means of doing that.  I've look through te docs, but I
don't see anything like it.  Just seems so intuitive though.

So, is anyone aware of a way to to this that doesn't require
scripting?  (Sorry if this is a newbie question -- I have looked).

--
Karl DeBisschop <kdebisschop@alert.infoplease.com>
617.832.0332 (Fax: 617.956.2696)

Information Please - your source for FREE online reference
http://www.infoplease.com  - Your Ultimate Fact Finder
http://kids.infoplease.com - The Great Homework Helper

pgsql-general by date:

Previous
From: richmond@shadow.net (Rich Ackerman)
Date:
Subject: backup strategy
Next
From: Nikos Mouat
Date:
Subject: timezone correction.