Query

Поиск
Список
Период
Сортировка
От Bob Pawley
Тема Query
Дата
Msg-id 02ae01c6eee6$82826430$8e904618@owner
обсуждение исходный текст
Ответы Re: Query  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
I have a trigger that produces an error "returns more than one row".
 
My intent is to fill one table (library.specification) from another (p_id.specification). The p_id table can have multiple instances of the same fluid but I want the library table to have only one record of each fluid.
 
Any insight into what is happening will be appreciated.
 
Bob Pawley
 
 
 create or replace function library_spec() returns trigger as $$
 begin
 
 Declare
  fluid_type varchar ;
 
 Begin
  Select fluid into fluid_type
 From p_id.specifications
 Where  fluid = new.fluid ;
 
 If fluid_type <> library.specifications.fluid Then
 Insert Into library.specifications (fluid) values (new.fluid_type) ;
 
 Elseif
 fluid_type = library.specifications.fluid Then
 Do Nothing ;
 
 End if ;
 return null ;
 end ;
 end ;
 $$ language plpgsql ;
 
 create trigger libspec after insert on p_id.processes
 for each row execute procedure library_spec();

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

Предыдущее
От: "Brian J. Erickson"
Дата:
Сообщение: Re: PostgreSQL Database Transfer between machines(again)
Следующее
От: brian
Дата:
Сообщение: Re: some log statements ignored