PortalHeapMemoryFree with user functions

From: Justen Marshall <justen(at)al(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: PortalHeapMemoryFree with user functions
Date: 2000-07-06 00:35:12
Message-ID: 00Jul6.103512est.115208@gateway.al.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I've written a simple string concatenation procedure to build a list
of comma-separated values. It is actually just a minor variation on
one the sample concatenation code, and yes I did make sure to adjust
the call to palloc to include the extra space I need for the comma.

I then built an aggregate function from it, and it seems to do the
trick nicely. But I've noticed some warnings in my postgres log file.

The functions are simple...

CREATE FUNCTION "csv" (text,text)
RETURNS text
AS 'cat.so'
LANGUAGE 'C';

CREATE AGGREGATE csvlist ( BASETYPE = text,
SFUNC1 = csv,
STYPE1 = text,
INITCOND1 = '' );

The warnings I get....

DEBUG: ExecInitAgg: could not find any aggregate functions
NOTICE: PortalHeapMemoryFree: 0x10312648 not in alloc set!

It actually works, though, that's the strange thing! But I'm not
certain it won't cause me problems later on, so I'd like to fix it.
And anyway, I'm a perfectionist, I don't like seeing warnings, and
since I'll be using this function in a heavy-load way, I think it's
fairly important that I find out what's wrong.

Your help would be appreciated!

BTW - If there is a better way to get a comma-separated value list
with some built-in aggregate function, feel free to fill me in! I
treated this as a learning exercise on building my own functions, but
I'd much prefer to do it natively if possible. I easily built an
equivalent of my 'csv' function in SQL, but discovered that SQL is not
a supported language for SFUNC's in aggregate functions. Bummer...

Justen
--
.-----------------------.------------.--------------------------.
| Justen Marshall | | e-mail: justen(at)al(dot)com(dot)au |
| Technical Director | | phone: +61-2-9383-4800 |
| Animal Logic Pty Ltd | | fax: +61-2-9383-4801 |
|-----------------------^------------^--------------------------|
| The beatings will continue until morale improves. |
`---------------------------------------------------------------'

Browse pgsql-general by date

  From Date Subject
Next Message Jim Wise 2000-07-06 01:11:42 Re: [HACKERS] Re: Revised Copyright: is this more palatable?
Previous Message Chris Bitmead 2000-07-06 00:30:40 Re: proposed improvements to PostgreSQL license