pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: phil@cobol-africa.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Triggers
Date: Wed, 09 Jun 2004 10:01:46 +0100
Message-ID: <40C6D1FA.4010907@archonet.com> (raw)
In-Reply-To: <NEBBKNKPCLAAGALDLMCBEEOPCHAA.phil@cobol-africa.com>
References: <NEBBKNKPCLAAGALDLMCBEEOPCHAA.phil@cobol-africa.com>

Philip J. Boonzaaier wrote:
> The technical reference gives an example of a trigger on a table - employee
> Just to test this, I have created the following table,
> CREATE TABLE employee
> (name VARCHAR(30),
> age int4,
> state VARCHAR(2),
> manager VARCHAR(3),
> adult VARCHAR(3)); 
> 
> The I created a simple Function, as follows :
> 
> CREATE FUNCTION trig_insert_update_check_emp() RETURNS opaque AS '

The "opaque" type has been split into several different ones, if you're 
using a recent version of PG, you'll want "RETURNS trigger".

[snip]
> Now, when I execute the following :
> 
> INSERT INTO employee (name,age,state,manager)
> VALUES ('sean',29,'tx','yes');
> 
> I get :
> 
> ERROR fmgr_info function 6264440 cache lookup failed

This usually means you redefined something - PG isn't smart enough (yet) 
to re-check all the dependencies in something like this. I'd guess you 
dropped/recreated the function after defining the trigger, yes?

The solution in older versions is to put the CREATE FUNCTION and CREATE 
TRIGGER in the same file so that you drop/recreate both together.

HTH
-- 
   Richard Huxton
   Archonet Ltd



view thread (34+ messages)  latest in thread

Message-ID: <40C6D1FA.4010907@archonet.com>
Permalink:  ../40C6D1FA.4010907@archonet.com/
Also on:    postgresql.org/message-id/40C6D1FA.4010907@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, phil@cobol-africa.com
  Subject: Re: Triggers
  In-Reply-To: <40C6D1FA.4010907@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox