From: Edmund Lian <no.spam@address.com>
To: pgsql-sql@postgresql.org
Subject: Re: Denormalizing during select
Date: Tue, 25 Feb 2003 03:44:02 GMT
Message-ID: <fhpl5v86vkhq26gifm9g4cb1kh2o2b6d6r@4ax.com> (raw)
References: <200302241433.49502.josh@agliodbs.com>
Jeff and Josh,
I found this example in "Practical PostgreSQL"... will it do the job?
"""
The following example defines an aggregate function named sum(), for
use with the text data type. This aggregate calls the
textcat(text,text) function built into PostgreSQL to return a
concatenated "sum" of all the text found in its input values:
booktown=# CREATE AGGREGATE sum ( BASETYPE = text,
booktown(# SFUNC = textcat,
booktown(# STYPE = text,
booktown(# INITCOND = '' );
CREATE
booktown=# SELECT sum(title || ' ') FROM books WHERE title ~ '^L';
sum
-------------------------------
Little Women Learning Python
(1 row)
"""
...Edmund.
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: no.spam@address.com
Subject: Re: Denormalizing during select
In-Reply-To: <fhpl5v86vkhq26gifm9g4cb1kh2o2b6d6r@4ax.com>
References: <200302241433.49502.josh@agliodbs.com> <fhpl5v86vkhq26gifm9g4cb1kh2o2b6d6r@4ax.com>
* 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