)]}'
{
  "commit": "d7e2e74c95d1ac941a124437198e19b42b15446d",
  "tree": "adc1ab1487e63eaf254f6cb22665f8ab17b88495",
  "parents": [
    "dbb880c77ddd1b43ddc396e05d300701860198aa"
  ],
  "author": {
    "name": "John Gemignani",
    "email": "jrgemignani@gmail.com",
    "time": "Tue Oct 13 13:50:40 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Oct 13 13:50:40 2026 -0700"
  },
  "message": "Reuse RLS-filtered graphs only within the traversal that loaded them (#2593)\n\nSince #2592, a query reuses an RLS-filtered graph across its traversals\nwhen a walker over the planned row-security quals judges that the\npolicies cannot change during the statement. The walker copies\nPostgreSQL\u0027s contain_mutable_functions_walker, treats SQL value\nfunctions such as CURRENT_DATE and current_user as fixed, and reads the\nquals through SPI_plan_get_plan_sources(), which PostgreSQL leaves\nundocumented.\n\nThe classification is not reliable. CURRENT_DATE, CURRENT_TIME,\nLOCALTIME and LOCALTIMESTAMP depend on the session TimeZone, which a\nstatement can change with set_config(), and the inspected quals do not\ncontain function default arguments, which the planner inserts later. A\npolicy comparing CURRENT_DATE with an immutable date expression showed 5\nlinks to the first of two traversals and, after the second switched the\ntime zone, the same 5 links to the second, where two scans of the label\nreturn 5 and 0. The walker also uses node types that PostgreSQL 16 and\nearlier do not have, so it cannot be backported unchanged, and every new\nnode type must be tracked by hand.\n\nRemove the walker and reuse a graph loaded through RLS only for the\ntraversal that loaded it, as already done for policies the walker\nclassified as varying. A traversal still loads the graph once instead of\nonce per row, so the 400-edge workload from the #2561 review still\nevaluates its policy 400 times instead of 160,000. A query with several\ntraversals of one RLS-protected graph loads it once per traversal.\nGraphs loaded without RLS are unaffected.\n\nIn rls_vle 8.3, two traversals with an immutable policy, alone and with\ncurrent_user, now evaluate it 40 times instead of 20; the other counts\nare unchanged.\n\nCo-authored-by: Copilot \u003c223556219+Copilot@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e567da5f53d19b99054d0004f68533c2156edf9d",
      "old_mode": 33188,
      "old_path": "regress/expected/rls_vle.out",
      "new_id": "2b114529b97e8bfec047771cf952a8d72dd0d52b",
      "new_mode": 33188,
      "new_path": "regress/expected/rls_vle.out"
    },
    {
      "type": "modify",
      "old_id": "11e6de507a56a00d84452ba569dc38591d4ff080",
      "old_mode": 33188,
      "old_path": "regress/sql/rls_vle.sql",
      "new_id": "1882e8cdab103fef3bc95d29c7a520d14f91387d",
      "new_mode": 33188,
      "new_path": "regress/sql/rls_vle.sql"
    },
    {
      "type": "modify",
      "old_id": "fae12d794e4e0f7a96258bdfe57dce9e09bc8293",
      "old_mode": 33188,
      "old_path": "src/backend/utils/adt/age_global_graph.c",
      "new_id": "1e366f3a9bc63e0aef63c8c91178921cfb6f5b30",
      "new_mode": 33188,
      "new_path": "src/backend/utils/adt/age_global_graph.c"
    }
  ]
}
