Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0DKo0B56059 for ; Sun, 13 Jan 2002 15:50:00 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id B5FADD5F1; Sun, 13 Jan 2002 12:50:00 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id A7A505BF4; Sun, 13 Jan 2002 12:50:00 -0800 (PST) Date: Sun, 13 Jan 2002 12:50:00 -0800 (PST) From: Stephan Szabo To: Sharon Cowling Cc: Subject: Re: Problem with unique index In-Reply-To: <200201132019.g0DKJLv15052@lambton.sslnz.com> Message-ID: <20020113124559.T16954-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200201/112 X-Sequence-Number: 6201 On Sun, 13 Jan 2002, Sharon Cowling wrote: > CREATE RULE addperson_rule AS ON INSERT TO addperson_view DO INSTEAD( > INSERT INTO person VALUES (new.person_id, new.firstname, new.lastname, > new.dob, new.street, new.suburb, new.city, new.homephone, > new.workphone, new.mobile, new.type, new.date_approved, > new.approved_by, new.vehicle_type, new.vehicle_rego, new.notes); I may be confused, but if you don't want to specify values for drivers_licence and firearms_licence in the above insert, aren't you doing to need to list the columns since notes comes after those columns? > Table Structure: > CREATE TABLE person( > person_id INT NOT NULL, > firstname VARCHAR(25) NOT NULL, > lastname VARCHAR(25) NOT NULL, > dob date NOT NULL, > street VARCHAR(50) NOT NULL, > suburb VARCHAR(50), > city VARCHAR(50) NOT NULL, > homephone INT, > workphone INT, > mobile INT, > type VARCHAR(30) NOT NULL, > date_approved DATE NOT NULL, > approved_by VARCHAR(50) NOT NULL, > vehicle_type VARCHAR(50), > vehicle_rego VARCHAR(6), > drivers_licence VARCHAR(10) UNIQUE, > firearms_licence VARCHAR(20) UNIQUE, > notes VARCHAR(80), > PRIMARY KEY (person_id));