From: darcy@druid.net
To: Gary MacMinn <G.MacMinn@nca.gov.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Merging two columns into one
Date: Fri, 23 Jun 2000 07:35:37 -0400 (EDT)
Message-ID: <m135RkH-000AY3C@druid.net> (raw)
In-Reply-To: <s9536097.001@syd_aux.nca.gov.au>
Thus spake Gary MacMinn
> I have two columns in a table (areacode and phone number) that I'd like to merge into one (phone number) containing both sets of info. Could anyone suggest a simple way of achieving this?
Oliver showed you how to merge these together with the SQL concatenate
operator but there is another possibility. PostgreSQL could use a
phone number type. I have been meaning to write a user defined type
for some time but never seem to get around to it. Maybe you could
give this a shot. The examples in contrib should get you started.
Once finished you can make the phone # one column and split out parts
with various functions. Don't forget to have a place for country code
and extension.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: darcy@druid.net, G.MacMinn@nca.gov.au
Subject: Re: Merging two columns into one
In-Reply-To: <m135RkH-000AY3C@druid.net>
References: <s9536097.001@syd_aux.nca.gov.au> <m135RkH-000AY3C@druid.net>
* 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