Re: drop index without accessexclusivelock in transaction (JAVA)
В списке pgsql-general по дате отправления:
| От | Jim Nasby |
|---|---|
| Тема | Re: drop index without accessexclusivelock in transaction (JAVA) |
| Дата | |
| Msg-id | 564CB64A.4030502@BlueTreble.com обсуждение исходный текст |
| Ответ на | drop index without accessexclusivelock in transaction (JAVA) (Emi <emilu@encs.concordia.ca>) |
| Список | pgsql-general |
On 11/18/15 10:48 AM, Emi wrote: > Hello, > > Through java jdbc, is it possible that we do the following steps without > accessexclusivelock for index: > > setautocommit(false); > > drop index1, 2,....; > insert millions records > set index1,2... > commit; > > Found this post, but it says only within psql block begin/commit, users > are able to do it. > http://stackoverflow.com/questions/19324637/postgres-transaction-seems-to-take-accessexclusivelock-for-no-reason You can't do it because the DROP needs an exclusive lock to ensure that no one else is trying to use the index when it's dropped. There is DROP INDEX CONCURRENTLY but IIRC you can't do that in a transaction. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера