Tr: CHECK CONSTRAINT - Mailing list pgsql-general

From Stéphane FILLON
Subject Tr: CHECK CONSTRAINT
Date
Msg-id 000301bedfdb$401c9740$c40a8280@portable
Whole thread Raw
List pgsql-general
-----Message d'origine-----
De : Stéphane FILLON <fillons@offratel.nc>
À : pgsql sql <pgsql-sql@postgresql.org>; pgsql admin
<pgsql-admin@postgresql.org>
Date : dimanche 1 août 1999 18:15
Objet : CHECK CONSTRAINT


>I have 2 tables ART and MTF as follow:
>
>create table art(
>artid    int4 primary key,
>mtfid    int4, -- can be null or foreign key with MTF
>
>constraint ck_mtfid check(mtfid is null or fk_mtfid(mtfid))
>);
>
>create table mtf(
>mtfid    int4 primary key
>);
>
>create function fk_mtfid(int4) returns bool as '
>declare
>    result int4;
>
>begin
>    select mtfid into result from mtf where mtfid = $1;
>
>    if found then
>        return true;
>    else
>        return false;
>    end if;
>end;
>' language 'plpgsql';
>
>
>The function works fine when I run it at the psql prompt, but when I tried
>to insert some tuple in ART I have the following error:
>
>"ERROR: init_fcache: Cache lookup failed for procedure 273568"
>
>
>Best Regards,
>
>Stephane.
>


pgsql-general by date:

Previous
From: "Stéphane FILLON"
Date:
Subject: Tr: Cache lookup failed with FUNCTION + TRIGGER
Next
From: Adriaan Joubert
Date:
Subject: Re: [GENERAL] Selecting duplicates