Update rule on a view - what am I doing wrong

Поиск
Список
Период
Сортировка
От Leif Jensen
Тема Update rule on a view - what am I doing wrong
Дата
Msg-id 896712.17467.1358518747042.JavaMail.root@quick
обсуждение исходный текст
Ответы Re: Update rule on a view - what am I doing wrong
Список pgsql-general
Hello,

   I have been fighting a problem with an update rule on a view. I have a view that combines two tables where the 'sub'
table(scont) can have several rows per row in the 'top' table (icont). The view combines these to show only one record
perrow in the top table. To be able to update on this view I have created a rule 'on update'. The rule needs to have
bothUPDATE, DELETE, and INSERT commands. Is this not possible or am I doing something else wrong ? 

   In the included sql script I have tried to show the problem. When the final update statement is executed, I get a
'duplicatekey violation' on a record that has never been there. 

   I am using PostgreSQL version 9.1.7 (running on Linux/Ubuntu 12.04). What am I doing wrong ?

   Please help,

 Leif

Вложения

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

Предыдущее
От: Igor Neyman
Дата:
Сообщение: Re: speeding up a join query that utilizes a view
Следующее
От: Tom Lane
Дата:
Сообщение: Re: String comparison and the SQL standard