Re: [HACKERS] array_accum aggregate

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: [HACKERS] array_accum aggregate
Date: 2006-10-13 08:05:57
Message-ID: 20061013080557.GB1896@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-10-13 08:12:18 Re: ./configure argument checking
Previous Message Albe Laurenz 2006-10-13 06:58:50 Re: [PATCHES] Documentation fix for --with-ldap

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-10-13 13:56:09 Re: [HACKERS] array_accum aggregate
Previous Message Tom Lane 2006-10-12 22:58:52 Re: array_accum aggregate