Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix FOR PORTION OF with non-updatable view columns

  1. bug: UPDATE FOR PORTION OF interact with updatable view

    jian he <jian.universality@gmail.com> — 2026-04-12T15:11:19Z

    hi.
    
    CREATE TABLE base_tbl (a int, b int, c int);
    INSERT INTO base_tbl values(1,2);
    CREATE VIEW rw_view15 AS SELECT a, ('[' || abs(b) ||
    ',20]')::int4range as b FROM base_tbl;
    
    UPDATE rw_view15 for portion of b from 1 to 10 set a = 2;
    DELETE FROM rw_view15 for portion of b from 1 to 10;
    
    The UPDATE will result
    ERROR:  attribute number 2 not found in view targetlist
    
    \errverbose
    ERROR:  XX000: attribute number 2 not found in view targetlist
    LOCATION:  rewriteTargetView, rewriteHandler.c:3779
    
    The DELETE will crash the server.
    
    Both should result in an error in rewriteTargetView.
    for UPDATE, the error message:
    ERROR:  cannot update column "b" of view "rw_view15"
    DETAIL:  View columns that are not columns of their base relation are
    not updatable.
    
    for DELETE, the error message:
    ERROR:  DELETE ... FOR PORTION OF is not supported for column "b" on
    view "rw_view15"
    DETAIL:  View columns that are not columns of their base relation are
    not updatable.
    
    Later, I will add this to
    https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items
    
    
    
    --
    jian
    https://www.enterprisedb.com/
    
  2. Re: bug: UPDATE FOR PORTION OF interact with updatable view

    Paul A Jungwirth <pj@illuminatedcomputing.com> — 2026-05-09T19:06:37Z

    On Sun, Apr 12, 2026 at 8:12 AM jian he <jian.universality@gmail.com> wrote:
    >
    > CREATE TABLE base_tbl (a int, b int, c int);
    > INSERT INTO base_tbl values(1,2);
    > CREATE VIEW rw_view15 AS SELECT a, ('[' || abs(b) ||
    > ',20]')::int4range as b FROM base_tbl;
    >
    > UPDATE rw_view15 for portion of b from 1 to 10 set a = 2;
    > DELETE FROM rw_view15 for portion of b from 1 to 10;
    >
    > The UPDATE will result
    > ERROR:  attribute number 2 not found in view targetlist
    >
    > \errverbose
    > ERROR:  XX000: attribute number 2 not found in view targetlist
    > LOCATION:  rewriteTargetView, rewriteHandler.c:3779
    >
    > The DELETE will crash the server.
    >
    > Both should result in an error in rewriteTargetView.
    > for UPDATE, the error message:
    > ERROR:  cannot update column "b" of view "rw_view15"
    > DETAIL:  View columns that are not columns of their base relation are
    > not updatable.
    >
    > for DELETE, the error message:
    > ERROR:  DELETE ... FOR PORTION OF is not supported for column "b" on
    > view "rw_view15"
    > DETAIL:  View columns that are not columns of their base relation are
    > not updatable.
    
    Thanks! I've attached a fix. I rewrote the DELETE error message a bit
    to match the existing errors in the file more closely.
    
    I'll make a CF entry.
    
    Yours,
    
    -- 
    Paul              ~{:-)
    pj@illuminatedcomputing.com
    
  3. Re: bug: UPDATE FOR PORTION OF interact with updatable view

    Peter Eisentraut <peter@eisentraut.org> — 2026-05-13T11:52:01Z

    On 09.05.26 21:06, Paul A Jungwirth wrote:
    > On Sun, Apr 12, 2026 at 8:12 AM jian he <jian.universality@gmail.com> wrote:
    >>
    >> CREATE TABLE base_tbl (a int, b int, c int);
    >> INSERT INTO base_tbl values(1,2);
    >> CREATE VIEW rw_view15 AS SELECT a, ('[' || abs(b) ||
    >> ',20]')::int4range as b FROM base_tbl;
    >>
    >> UPDATE rw_view15 for portion of b from 1 to 10 set a = 2;
    >> DELETE FROM rw_view15 for portion of b from 1 to 10;
    >>
    >> The UPDATE will result
    >> ERROR:  attribute number 2 not found in view targetlist
    >>
    >> \errverbose
    >> ERROR:  XX000: attribute number 2 not found in view targetlist
    >> LOCATION:  rewriteTargetView, rewriteHandler.c:3779
    >>
    >> The DELETE will crash the server.
    >>
    >> Both should result in an error in rewriteTargetView.
    >> for UPDATE, the error message:
    >> ERROR:  cannot update column "b" of view "rw_view15"
    >> DETAIL:  View columns that are not columns of their base relation are
    >> not updatable.
    >>
    >> for DELETE, the error message:
    >> ERROR:  DELETE ... FOR PORTION OF is not supported for column "b" on
    >> view "rw_view15"
    >> DETAIL:  View columns that are not columns of their base relation are
    >> not updatable.
    > 
    > Thanks! I've attached a fix. I rewrote the DELETE error message a bit
    > to match the existing errors in the file more closely.
    > 
    > I'll make a CF entry.
    
    committed