Re: [HACKERS] pg_dump bug - problems along the way
jose' soares <sferac@bo.nettuno.it>
From: Sferacarta Software <sferac@bo.nettuno.it>
To: hackers@postgresql.org, "Oliver Elphick" <olly@lfix.co.uk>
Date: 1998-11-23T14:35:34Z
Lists: pgsql-hackers
Hello Oliver,
sabato, 21 novembre 98, you wrote:
OE> Still trying to fix the bug with inherited check constraints...
OE> I have tried to create a min(oid) aggregate, but when I use it, I get
OE> the message `ERROR: fmgr_info: function 108994: cache lookup failed'.
OE> What is the problem, please?
OE> I created it thus:
OE> create function oid4smaller (oid, oid) returns oid as
OE> '/home/olly/cprogs/oidcompare.so' language 'c';
OE> create aggregate min (basetype = oid, sfunc1 = oid4smaller,
OE> stype1 = oid, stype2 = oid);
Try this...it works...
create function oid4smaller (oid, oid) returns oid as
'
begin
if $1 > $2 then
return $2;
else
return $1;
end if;
end;
' language 'plpgsql';
create aggregate m (basetype = oid, sfunc1 = oid4smaller,
stype1 = oid, stype2 = oid);
prova=> select oid from a;
oid
------
376064
376065
380064
380065
380066
380067
(6 rows)
prova=> select min(oid) from a;
min
------
376064
(1 row)
-Jose'-