Linking

Поиск
Список
Период
Сортировка
От Bob Pawley
Тема Linking
Дата
Msg-id 01be01c5df32$b1e87e90$ac1d4318@OWNER
обсуждение исходный текст
Ответы Re: Linking  (Oliver Elphick <olly@lfix.co.uk>)
Re: Linking  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general

I have created the following tables.

 

First Table -

 

CREATE TABLE process

(

  process_name varchar(60) NOT NULL,

  fluid_id serial NOT NULL,

  fluid varchar(30) NOT NULL,

  ip_op_reactor varchar(3),

  source varchar(30),

  destination varchar(30),

  CONSTRAINT process_pk PRIMARY KEY (fluid_id)

);

 

---------

 Second Table -

 

CREATE TABLE specification

(

  fluid_id int4 NOT NULL,

  line_vessel_ident varchar(30),

  CONSTRAINT specification_pk PRIMARY KEY (fluid_id),

  CONSTRAINT specification_fluid_id_fk FOREIGN KEY (fluid_id) REFERENCES process (fluid_id)

);

 

On data entry I want the serial number generated in process.fluid_id to be transferred to column  specification.fluid_id.

A simple insert/select command will transfer the serial number but entering a second row then employing an insert/select command violates the p_k unique rule.

 

What do I need to do?

 Bob

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: PostgreSQL on 64-bit operating systems
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: PostgreSQL, Mac OS X and locales