pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ismail Bouabdallah <bouabdi9@cs.man.ac.uk>
To: pgsql-sql@postgresql.org
Subject: PL/pgsql
Date: Mon, 04 Mar 2002 18:32:33 +0000
Message-ID: <3C83BDC1.9E181438@cs.man.ac.uk> (raw)

Hi can any one help me out with the following trigger that I have
written....


CREATE FUNCTION new_site() RETURNS OPAQUE AS '
BEGIN
 IF NEW.SITE_REFERNCE = SITE_REFERENCE
 THEN
 SITE.END_DATE := NEW.START_DATE
 SITE.CURRENCY_FLAG := 2
END;
' LANGUAGE 'plpgsql';

CREATE TRIGGER NEWSITE
AFTER INSERT ON SITE
FOR EACH ROW
EXECUTE PROCEDURE new_site();

the trigger enforces versioning of new sites inserted into the site
table of my land_use database....
but after defining the function I can no longer insert new sites into
the database.

i receive the following error from psql:

ERROR:  fmgr_info: function 56664: cache lookup failed

when I try to insert the following data:

INSERT INTO SITE
(SITE_REFERENCE,UPRN,LA_REFERENCE,VERSION_NO,CURRENCY_FLAG,START_DATE,END_DATE,EASTING,NORTHING,PAO_DESCRIPTION,STREET_DESCRIPTION,LOCALITY_DESCRIPTION,TOWN_DESCRIPTION,POSTCODE,LA_CODE,AREA,LAND_TYPE_REF,LAND_USE_DIVISION_REF,LAND_USE_CLASS_REF,LAND_USE_SUB_CLASS_REF,DERELICTION_REF,OWNER_REF,PLANNING_STATUS_REF,PROPOSED_USE_REF,HOUSING_COMPONENT,HOUSING_SUIT_REF,MOST_SUITABLE_USE_REF,EST_HOUSING_CAPACITY,HOUSING_DENSITY,LEGAL_CONSTRAINTS,PHYSICAL_CONSTRAINTS,AVAILABLE_ON_MARKET,AGENT_NAME,EP_RDA_INVOLVEMENT,GENERAL_SITE_INFORMATION,BOUNDARY_ID)

 VALUES (345600001,null,null,2,1,'20020311',null,414722,130160,'57 TO
61','GREENCROFT STREET',null,'SNAILSBURY','SN3
5BX',3456,0.062,2,11,44,133,11,3,4,2,4,1,2,10,161,1,2,3,null,2,null,3456000011);

Attachments:

bouabdi9.vcf (text/x-vcard, 187B) download begin:vcard n:Bouabdallah;Ismail x-mozilla-html:FALSE adr:;;;;;; version:2.1 email;internet:bouabdi9@cs.man.ac.uk` title:Mr I.Bouabdallah x-mozilla-cpt:;0 fn:Ismail Bouabdallah end:vcard

view thread (13+ messages)  latest in thread

Message-ID: <3C83BDC1.9E181438@cs.man.ac.uk>
Permalink:  ../3C83BDC1.9E181438@cs.man.ac.uk/
Also on:    postgresql.org/message-id/3C83BDC1.9E181438@cs.man.ac.uk

 · 

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: bouabdi9@cs.man.ac.uk
  Subject: Re: PL/pgsql
  In-Reply-To: <3C83BDC1.9E181438@cs.man.ac.uk>

* 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