Re: How to build this field

From: Christof Glaser <gcg(at)gl(dot)aser(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to build this field
Date: 2001-03-08 17:13:38
Message-ID: 0103081813380F.12945@pinguin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-03-08 17:50:33 Re: Re: How to drop an <unnamed> trigger
Previous Message Frank Joerdens 2001-03-08 16:51:26 Re: Re: How to drop an <unnamed> trigger