Thread

Commits

  1. Forbid FOR PORTION OF with WHERE CURRENT OF

  1. FOR PORTION OF should not allow WHERE CURRENT OF

    Paul A Jungwirth <pj@illuminatedcomputing.com> — 2026-06-17T05:10:48Z

    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@illuminatedcomputing.com
    
  2. Re: FOR PORTION OF should not allow WHERE CURRENT OF

    Peter Eisentraut <peter@eisentraut.org> — 2026-06-29T13:27:18Z

    On 17.06.26 07:10, Paul A Jungwirth wrote:
    > 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.
    
    committed