Re: backend dies on my aggregate function in 7.1.2 - Mailing list pgsql-general

From Tom Lane
Subject Re: backend dies on my aggregate function in 7.1.2
Date
Msg-id 26405.998714229@sss.pgh.pa.us
Whole thread Raw
In response to backend dies on my aggregate function in 7.1.2  (Dirk Lutzebaeck <lutzeb@aeccom.com>)
List pgsql-general
Dirk Lutzebaeck <lutzeb@aeccom.com> writes:
> *** the aggregate is then created by

> CREATE AGGREGATE maxalphanum (
>    SFUNC1 = maxalphanum_check,
>    BASETYPE = TEXT,
>    STYPE1 = TEXT
> );

You've not specified any initial condition for the aggregate's state
value.  This means the state starts out NULL ... and your transition
function isn't handling that.

You probably want to mark the transition function 'strict', but you
also need to consider what the initial condition should be: what do
you want returned for no input rows?

            regards, tom lane

pgsql-general by date:

Previous
From: "Rob Arnold"
Date:
Subject: Re: problems transfering databases
Next
From: Peter Eisentraut
Date:
Subject: Re: Error reporting when hitting shared memory limits -