| From: | Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Cc: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
| Subject: | FOR PORTION OF should not allow WHERE CURRENT OF |
| Date: | 2026-06-17 05:10:48 |
| Message-ID: | CA+renyUEKPexUYsH4qeU8_o1jqKsUkEWca1keS6n21shgG1g+A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Dear Hackers,
I found a bug with FOR PORTION OF: you shouldn't be able to provide it
while using WHERE CURRENT OF with a cursor, but you can. (And it
doesn't do anything sensible.)
According to the SQL standard, combining these is not allowed: you can
give FOR PORTION OF with an <update/delete statement: searched> but
not an <update/delete statement: positioned>. I've attached a patch to
raise an error if you try to use both.
It actually might be nice to support combining them, eventually. But
not in v19. IMO if you gave both, the UPDATE/DELETE would have no
effect if FOR PORTION OF didn't match the row. But maybe that violates
the promise of WHERE CURRENT OF. After all, we don't allow any other
extra conditions when using that syntax.
Yours,
--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Forbid-FOR-PORTION-OF-with-WHERE-CURRENT-OF.patch | application/octet-stream | 7.2 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bertrand Drouvot | 2026-06-17 05:12:34 | Re: faulty error handling around pgstat_count_io_op_time() |
| Previous Message | David Rowley | 2026-06-17 05:04:43 | Re: Fix tuple deformation with virtual generated NOT NULL columns |