pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Schoenster <borg@errorcode.com>
To: pgsql-sql@postgresql.org
Subject: must I create the function check_primary_key ?
Date: Wed, 25 Apr 2001 21:48:46 -0600
Message-ID: <3AE7463E.27747.CD77E8D@localhost> (raw)

Hi,

Thanks to many who clued me on on using "arrow keys" to 
traverse history. I just installed readline and 7.1 .. seems that 
mysql has its own readline.

I want to use this referential integrity etc. that I've never used in 
mysql ... so I tried many things and looked here and there ... My 
example below produces this error:

> CreateTrigger: function check_primary_key() does not exist

Here is what I was trying to create:

DROP TABLE company_profile;

CREATE TABLE company_profile (
	employer_id int4,	
	leadership text,
	company_description  text,
	key_financial_statictics varchar (255),
	company_name varchar (255),
	url varchar (255),
	sec_fillings_url varchar (255),
	mission text,
	employees int4,
	type varchar (50),
	growth_rate varchar (50),
	culture  text,
	year int4,
	PRIMARY KEY (employer_id)
);

CREATE TRIGGER employer_id_exists
BEFORE INSERT OR UPDATE ON company_profile FOR EACH 
ROW
EXECUTE PROCEDURE check_primary_key('employer_id', 
'employer_profile', 'employer_id');

__end example

I just copied the above TRIGGER  .... but it doesn't work for me.

Thanks,

Peter
All idioms must be learned.
Good idioms only need to be learned once. 
--Alan Cooper



view thread (3+ messages)  latest in thread

Message-ID: <3AE7463E.27747.CD77E8D@localhost>
Permalink:  ../3AE7463E.27747.CD77E8D@localhost/
Also on:    postgresql.org/message-id/3AE7463E.27747.CD77E8D@localhost

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: borg@errorcode.com
  Subject: Re: must I create the function check_primary_key ?
  In-Reply-To: <3AE7463E.27747.CD77E8D@localhost>
  References: <3AE7463E.27747.CD77E8D@localhost>

* 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