From: Christof Glaser <gcg@gl.aser.de>
To: pgsql-sql@postgresql.org
Subject: Re: How to build this field
Date: Thu, 8 Mar 2001 18:13:38 +0100
Message-ID: <0103081813380F.12945@pinguin> (raw)
In-Reply-To: <web-22191@davinci.ethosmedia.com>
References: <web-22191@davinci.ethosmedia.com>
Josh,
> > [ stuff deleted ]
> > CREATE FUNCTION metakey (text, int4, int4) returns text as
> > ' SELECT $1 || ' ' || text($2) || ' ' || text($3) '
> > LANGUAGE 'sql';
> >
> > || is the "concatenate text" operator.
> >
> > Change the param types and cast them as you need.
>
> ... But keep in mind that if any of the above values are NULL, the
> whole expression will be NULL. If one or more of the columns allows
> NULLs, you will need a function that includes testing for NULL.
>
> -Josh Berkus
Thanks for the hint. COALESCE is your friend, then :)
Christof.
--
gl.aser . software engineering . internet service
http://gl.aser.de/ . Planckstraße 7 . D-39104 Magdeburg
Tel. +49.391.7 44 77 10 . Fax +49.391.7 44 77 13 . Mobil 0177.77 92 84 3
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: gcg@gl.aser.de
Subject: Re: How to build this field
In-Reply-To: <0103081813380F.12945@pinguin>
References: <web-22191@davinci.ethosmedia.com> <0103081813380F.12945@pinguin>
* 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