The patch allows for a LIMIT clause on a DELETE or UPDATE statement.
Why is this needed?
- I have a table which has several identical entries, and I want to
delete or update just one of them (I don't care which one, obviously).
And, no, I cannot use OIDS because they'd represent unwanted overhead
(the table contains a lot of entries).
- It allows you to speed up DELETE or UPDATE statements which are known
in advance to match only one record by adding a LIMIT 1.
- It makes migrations from MySQL to PostgreSQL easier (MySQL already
supports LIMIT on DELETEs and UPDATEs). It might simplify other migrations
as well, I'm not sure what other DBMSes support the construct.
The patch includes documentation updates (which might need to be edited
to change the look and feel to the rest of the documentation).
When checking the patches, please pay attention to the three extra warnings
the yacc file now generates. I looked into it, but can't see the
problem, actually (I'm probably overlooking something).
Stephen R. van den Berg (AKA BuGless).
"Sleep: A completely inadequate substitute for caffeine."
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2002-09-21 15:24:25|
|Subject: Re: Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1) |
|Previous:||From: Nigel J. Andrews||Date: 2002-09-20 22:18:00|
|Subject: Re: Memory Errors...|