Inserting into a master table with partitions does not return rows affected.
В списке pgsql-general по дате отправления:
| От | rverghese |
|---|---|
| Тема | Inserting into a master table with partitions does not return rows affected. |
| Дата | |
| Msg-id | 1462832551784-5902708.post@n5.nabble.com обсуждение исходный текст |
| Ответы |
Re: Inserting into a master table with partitions does not
return rows affected.
|
| Список | pgsql-general |
I am moving towards a partitioned schema. I use a function to insert into the table. If the INSERT fails because of duplicates I do an UPDATE. This works fine currently on the non-partitioned table because I can use GET DIAGNOSTICS to get the row count on the INSERT. But when I use the Master table to insert into the partitions, GET DIAGNOSTICS always returns 0. So there is no way of knowing whether a row was inserted (I am catching the unique violation exception to do the UPDATE). What is a good alternative? We are on 9.4, so the UPSERT is not yet available to me. There should be some way to know if data was inserted into the partition. Thanks RV -- View this message in context: http://postgresql.nabble.com/Inserting-into-a-master-table-with-partitions-does-not-return-rows-affected-tp5902708.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера