Received: from linux.scd.net ([209.150.198.180]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3Q333385083 for ; Wed, 25 Apr 2001 23:03:03 -0400 (EDT) (envelope-from borg@errorcode.com) Received: from home ([209.150.198.179]) by linux.scd.net (8.9.3/8.9.3) with ESMTP id TAA32579 for ; Wed, 25 Apr 2001 19:55:24 -0600 From: "Peter J. Schoenster" Organization: Schoenster To: pgsql-sql@postgresql.org Date: Wed, 25 Apr 2001 21:48:46 -0600 Subject: must I create the function check_primary_key ? Reply-to: borg@errorcode.com Message-ID: <3AE7463E.27747.CD77E8D@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) X-Archive-Number: 200104/394 X-Sequence-Number: 2752 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