Re: pg_dump && aggregate bug

From: Mathieu Arnold <mat(at)mat(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_dump && aggregate bug
Date: 2002-05-27 12:36:08
Message-ID: 2839635289.1022510168@andromede.reaumur.absolight.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

--On mardi 21 mai 2002 10:19 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Mathieu Arnold <mat(at)mat(dot)cc> writes:
>> when I dump my database, in the dump file, the aggregate becomes :
>
>> CREATE AGGREGATE first ( BASETYPE = text, SFUNC = first_cat, STYPE =
>> text, INITCOND = '' );
>
> Ooops. This seems to be fixed already in current sources, but I think
> a back-patch to 7.2 may be warranted. Try this around line 1912:
>
> agginfo[i].aggbasetype = strdup(PQgetvalue(res, i,
> i_aggbasetype)); - agginfo[i].agginitval = strdup(PQgetvalue(res,
> i, i_agginitval)); + if (PQgetisnull(res, i, i_agginitval))
> + agginfo[i].agginitval = NULL;
> + else
> + agginfo[i].agginitval = strdup(PQgetvalue(res, i,
> i_agginitval)); agginfo[i].usename = strdup(PQgetvalue(res, i,
> i_usename));
>
> regards, tom lane

worked, thanks.
I wonder if it could go into a possible 7.1.2 if there is one ? :)

--
Mathieu Arnold

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message andrea gelmini 2002-05-27 16:21:28 problem with date cast
Previous Message Andrew McMillan 2002-05-27 09:43:47 Documentation regarding %ROWTYPE in PL/PgSQL