Creating function and aggregate - problem

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Creating function and aggregate - problem
Date: 1998-11-23 14:18:20
Message-ID: 199811231418.OAA10876@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have tried to create a min(oid) aggregate, but when I use it, I get
the message `ERROR: fmgr_info: function 108994: cache lookup failed'.

What does this mean, please?

I created it thus:

create function oid4smaller (oid, oid) returns oid as
'/home/olly/cprogs/oidcompare.so' language 'c';

create aggregate min (basetype = oid, sfunc1 = oid4smaller,
stype1 = oid, stype2 = oid);

The C file is compiled and linked thus (for Linux x86):

$ gcc -o oidcompare.o -c -I/usr/include/postgresql oidcompare.c
$ gcc -shared -o oidcompare.so oidcompare.o

and it says:
#include <postgresql/postgres.h>

Oid oid4smaller(Oid o1, Oid o2) {
return (o1 < o2 ? o1 : o2);
}

Oid oid4larger(Oid o1, Oid o2) {
return (o1 > o2 ? o1 : o2);
}

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"The LORD is nigh unto all them that call upon him, to
all that call upon him in truth."
Psalms 145:18

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Memphisto 1998-11-23 14:37:57 ERROR: Unable to decode datetime
Previous Message Memphisto 1998-11-23 09:43:17 On archived databases