Re: Problem with unique index - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Problem with unique index
Date
Msg-id 20020113124559.T16954-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Problem with unique index  (Sharon Cowling <sharon.cowling@sslnz.com>)
List pgsql-sql
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));



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with unique index
Next
From: pocm@rnl.ist.utl.pt (Paulo J. Matos)
Date:
Subject: pg with different sql?