Re: [PATCHES] array_accum aggregate - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: [PATCHES] array_accum aggregate
Date
Msg-id 20061013080557.GB1896@svana.org
Whole thread Raw
In response to Re: [PATCHES] array_accum aggregate  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCHES] array_accum aggregate
List pgsql-hackers
On Thu, Oct 12, 2006 at 06:58:52PM -0400, Tom Lane wrote:
> I wrote:
> > aggregate_state would have no other uses in the system, and its input
> > and output functions would raise an error, so type safety is assured
> > --- there would be no way to call either the sfunc or ffunc "manually",
> > except by passing a NULL value, which should be safe because that's what
> > they'd expect as the aggregate initial condition.
>
> Um, no, I take that back, unless you want to invent a separate
> pseudotype for each such aggregate.  Otherwise you can crash it with

<snip>

What this really calls for is a type that users are forbidden to
interact with directly. Basically, the type may only be used by C
functions and such C functions may not appear in an SQL query.

Seems the only way to safely deal with datums you don't know the
representation of.

The name "internal" would be nice, but it's taken :(

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: [PATCHES] Documentation fix for --with-ldap
Next
From: Martijn van Oosterhout
Date:
Subject: Re: ./configure argument checking