Skip site navigation (1) Skip section navigation (2)

Re: Changes to functions and triggers

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: hackers(at)PostgreSQL(dot)org
Subject: Re: Changes to functions and triggers
Date: 2000-06-20 19:33:33
Message-ID: m134Tm9-000AY5C@druid.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Thus spake Tom Lane
> darcy(at)druid(dot)net (D'Arcy J.M. Cain) writes:
> > OK, so I went back to basically what I had before.
> 
> > CREATE FUNCTION make_date()                   
> >     RETURNS opaque
> >     AS '/usr/pgsql/modules/make_date.so'    
> >     LANGUAGE 'c';
> 
> > CREATE TRIGGER make_dates
> >     BEFORE INSERT OR UPDATE ON bgroup
> >     FOR EACH ROW
> >     EXECUTE PROCEDURE make_date (edate, aniv, emon, eyear);
> 
> > INSERT INTO bgroup (bname, client_id, actypid, aniv, emon, eyear, pmon, pyear)
> > 	VALUES ('guest', 1000, 1, 1, 1, 2000, 1, 2000);
> 
> Looks OK to me.
> 
> > And here is what I get.
> > ERROR:  fmgr_info: function 24224: cache lookup failed
> 
> You sure you didn't fall into the same old trap of you-must-create-
> the-trigger-after-the-function?  If you drop and recreate the function,
> it has a new OID, so you have to drop and recreate the trigger because
> it links to the function by OID.

Positive.  I dropped both then did the above in the order shown.

-- 
D'Arcy J.M. Cain <darcy(at){druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-06-20 19:42:15
Subject: Re: Changes to functions and triggers
Previous:From: Bruce MomjianDate: 2000-06-20 18:03:58
Subject: Re: Re: PostgreSQL aggregate function documentation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group