Re: Denormalizing during select - Mailing list pgsql-sql

From Edmund Lian
Subject Re: Denormalizing during select
Date
Msg-id fhpl5v86vkhq26gifm9g4cb1kh2o2b6d6r@4ax.com
Whole thread Raw
In response to Re: Denormalizing during select  (Josh Berkus <josh@agliodbs.com>)
List 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.


pgsql-sql by date:

Previous
From: "Tambet Matiisen"
Date:
Subject: Re: good style?
Next
From: no.spam@address.com
Date:
Subject: Re: Denormalizing during select