From: | Miroslav Šulc <miroslav(dot)sulc(at)startnet(dot)cz> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | DELETE ... USING ... - 8.0 and 8.1 compatibility problem |
Date: | 2006-05-31 21:34:43 |
Message-ID: | 447E0BF3.2040707@startnet.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
Attachment | Content-Type | Size |
---|---|---|
miroslav.sulc.vcf | text/x-vcard | 349 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-05-31 21:50:19 | Re: DELETE ... USING ... - 8.0 and 8.1 compatibility problem |
Previous Message | filippo | 2006-05-31 17:53:59 | datestyle on windows environment: how to set? |