Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1) - Mailing list pgsql-patches

From srb@cuci.nl (Stephen R. van den Berg)
Subject Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1)
Date
Msg-id 20020921141206.GA32585@cuci.nl
Whole thread Raw
Responses Re: Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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).
--
Sincerely,                                                          srb@cuci.nl
           Stephen R. van den Berg (AKA BuGless).

"Sleep: A completely inadequate substitute for caffeine."

Attachment

pgsql-patches by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: Memory Errors...
Next
From: Tom Lane
Date:
Subject: Re: Implementation of LIMIT on DELETE and UPDATE statements (rel to 7.2.1)