pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Terence Kearns <terencek@isd.canberra.edu.au>
To: pgsql-sql@postgresql.org
Subject: parse error for function def
Date: Thu, 17 Jul 2003 20:46:53 +1000
Message-ID: <3F167E9D.2090709@cts.canberra.edu.au> (raw)

CREATE FUNCTION base.fn_fkey_check(text, text, int4) RETURNS bool AS
'DECLARE
BEGIN
   RETURN (SELECT count($1) FROM $2 where $1 = $3)::bool;
END;'
LANGUAGE 'sql';

produces this error
ERROR:  parser: parse error at or near "RETURN" at character 20

I'm trying to create a function to use on a trigger to check reference 
to views since pg does not support foreign keys referencing views.



-- 
Terence Kearns ~ ph: +61 2 6201 5516
IT Database/Applications Developer
Enterprise Information Systems
Client Services Division
University of Canberra
www.canberra.edu.au




view thread (5+ messages)  latest in thread

Message-ID: <3F167E9D.2090709@cts.canberra.edu.au>
Permalink:  ../3F167E9D.2090709@cts.canberra.edu.au/
Also on:    postgresql.org/message-id/3F167E9D.2090709@cts.canberra.edu.au

 · 

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: terencek@isd.canberra.edu.au
  Subject: Re: parse error for function def
  In-Reply-To: <3F167E9D.2090709@cts.canberra.edu.au>

* 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