Re: Denormalizing during select

From: Edmund Lian <no(dot)spam(at)address(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Denormalizing during select
Date: 2003-02-25 03:44:02
Message-ID: fhpl5v86vkhq26gifm9g4cb1kh2o2b6d6r@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rudi Starcevic 2003-02-25 05:48:41 Sub Select inside Check ?
Previous Message no.spam 2003-02-25 03:37:41 Re: Denormalizing during select