Re: How to implement the skip errors for copy from ?
От | Tom Lane |
---|---|
Тема | Re: How to implement the skip errors for copy from ? |
Дата | |
Msg-id | 16380.1403012443@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: How to implement the skip errors for copy from ? (xbzhang <xbzhang@kingbase.com.cn>) |
Список | pgsql-hackers |
xbzhang <xbzhang@kingbase.com.cn> writes: > LWlocks can record in resource owner per tuples, so they can be released at rigth way, but the memory allocated on memorycontext is one problem.Are there any others problems? See AbortSubTransaction(), CleanupSubTransaction(), and the rather large number of subroutines they call. Almost everything that code does is connected to cleaning up something that might have been left unfinished after an elog(ERROR) took control away in the middle of some code sequence. In addition, you can't just wave your hands and presto the bad tuple is not there anymore. For example, the failure might have been a unique key violation in some index or other. Not only is the bad tuple already on disk, but possibly so are index entries for it in other indexes. In general the only way to get rid of those index entries is a VACUUM. So you really have to have a subtransaction whose XID is what you mark the new tuple with, and then rolling back the subtransaction is what causes the new tuple to not be seen as good. (Actually getting rid of it will be left for the next VACUUM.) regards, tom lane
В списке pgsql-hackers по дате отправления: