Re: Problem with unique index

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Problem with unique index
Дата
Msg-id 20020113124559.T16954-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Problem with unique index  (Sharon Cowling <sharon.cowling@sslnz.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with unique index
Следующее
От: pocm@rnl.ist.utl.pt (Paulo J. Matos)
Дата:
Сообщение: pg with different sql?