Hello, I have an SQL DELETE command that selects the items that should be deleted against two large sets of data. This is the query: DELETE FROM MRTPQuotaItem_MRTPContact USING MRTPQuotaItem, MRTPQuota, MRTPContact WHERE (MRTPQuotaItemId = MRTPQuotaItem.Id AND MRTPQuotaItem.MRTPQuotaId = MRTPQuota.Id AND MRTPQuota.MRTPWaveQuestionnaireId = 1) AND (MRTPContactId = MRTPContact.Id AND MRTPContact.MRTPWaveQuestionnaireId != 1) The problem is that I have application deployed both on pg 8.0 and pg 8.1. This syntax (using USING) is only valid for 8.1+ and syntax without USING is only valid for 8.0 and not for 8.1. I could write it using IN operators which works in both versions but the slowdown is not acceptable. Is there a way to write the command so that both versions of pg accept it and not to use IN operator which unacceptably slows the thing down in this case? Thank you for any suggestion. -- Miroslav Šulc
Miroslav Šulc <miroslav.sulc@startnet.cz> writes:
> The problem is that I have application deployed both on pg 8.0 and pg
> 8.1. This syntax (using USING) is only valid for 8.1+ and syntax without
> USING is only valid for 8.0 and not for 8.1. I could write it using IN
> operators which works in both versions but the slowdown is not acceptable.
Set add_missing_from TRUE ...
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера