{"kind": "hook", "major": "18", "item": {"slug": "planner_shutdown_hook", "name": "planner_shutdown_hook", "name_zh": "planner_shutdown_hook", "category": "Query planning", "summary": "Not recorded in the selected version.", "aliases": [], "versions": {"19": {"facts": [{"label": "Interface type", "value": "planner_shutdown_hook_type"}, {"label": "Header", "value": "src/include/optimizer/planner.h"}, {"label": "Subsystem", "value": "Query planning"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/19/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "REL_19_BETA4", "label": "19 Beta 4", "major": "19", "channel": "preview", "revision": "b73d13c32c834a2c8e1c60cb92f79530376cedf1"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/b73d13c32c834a2c8e1c60cb92f79530376cedf1/src/include/optimizer/planner.h#L44", "path": "src/include/optimizer/planner.h", "label": "Interface declaration", "sha256": "4d38d7e4dd9956ef015711e8bf3262ea52631558a0eea290d4fa14ac517c5407"}, {"url": "https://github.com/postgres/postgres/blob/b73d13c32c834a2c8e1c60cb92f79530376cedf1/src/backend/optimizer/plan/planner.c#L80", "path": "src/backend/optimizer/plan/planner.c", "label": "Core definition", "sha256": "f71d959162a35db9df0f7b54c0fb7980fd61d80e8da24b1adae7c0dafb33b1c4"}, {"url": "https://github.com/postgres/postgres/blob/b73d13c32c834a2c8e1c60cb92f79530376cedf1/src/backend/optimizer/plan/planner.c#L735", "path": "src/backend/optimizer/plan/planner.c", "label": "Call sites", "sha256": "f71d959162a35db9df0f7b54c0fb7980fd61d80e8da24b1adae7c0dafb33b1c4"}], "sections": [{"title": "Core source comments", "paragraphs": ["Allow plugins to take control before we discard \"glob\""]}, {"title": "Call sites", "paragraphs": ["src/backend/optimizer/plan/planner.c:735"]}, {"code": "\t\tif (jit_tuple_deforming)\n\t\t\tresult->jitFlags |= PGJIT_DEFORM;\n\t}\n\n\t/* Allow plugins to take control before we discard \"glob\" */\n\tif (planner_shutdown_hook)\n\t\t(*planner_shutdown_hook) (glob, parse, query_string, result);\n\n\tif (glob->partition_directory != NULL)\n\t\tDestroyPartitionDirectory(glob->partition_directory);\n\n\treturn result;\n}\n\n", "title": "Core call context: src/backend/optimizer/plan/planner.c:729\u2013743", "paragraphs": []}], "signature": "typedef void (*planner_shutdown_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt);\nextern PGDLLIMPORT planner_shutdown_hook_type planner_shutdown_hook;", "description": ["Hook for plugins to get control before PlannerGlobal is discarded"]}, "20": {"facts": [{"label": "Interface type", "value": "planner_shutdown_hook_type"}, {"label": "Header", "value": "src/include/optimizer/planner.h"}, {"label": "Subsystem", "value": "Query planning"}, {"label": "Initial value", "value": "NULL (no hook installed)"}], "related": [{"url": "/docs/devel/planner-optimizer.html", "label": "The Planner/Optimizer"}], "release": {"ref": "master", "label": "20 devel", "major": "20", "channel": "devel", "revision": "2c10c2ce4d7bcd57543a49ab402af02a39724e0a"}, "sources": [{"url": "https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/include/optimizer/planner.h#L44", "path": "src/include/optimizer/planner.h", "label": "Interface declaration", "sha256": "4d38d7e4dd9956ef015711e8bf3262ea52631558a0eea290d4fa14ac517c5407"}, {"url": "https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/optimizer/plan/planner.c#L80", "path": "src/backend/optimizer/plan/planner.c", "label": "Core definition", "sha256": "fbcf53dca02672e0d1757d98942126dd22a4bcadf5a2323710f76d854fe84395"}, {"url": "https://github.com/postgres/postgres/blob/2c10c2ce4d7bcd57543a49ab402af02a39724e0a/src/backend/optimizer/plan/planner.c#L735", "path": "src/backend/optimizer/plan/planner.c", "label": "Call sites", "sha256": "fbcf53dca02672e0d1757d98942126dd22a4bcadf5a2323710f76d854fe84395"}], "sections": [{"title": "Core source comments", "paragraphs": ["Allow plugins to take control before we discard \"glob\""]}, {"title": "Call sites", "paragraphs": ["src/backend/optimizer/plan/planner.c:735"]}, {"code": "\t\tif (jit_tuple_deforming)\n\t\t\tresult->jitFlags |= PGJIT_DEFORM;\n\t}\n\n\t/* Allow plugins to take control before we discard \"glob\" */\n\tif (planner_shutdown_hook)\n\t\t(*planner_shutdown_hook) (glob, parse, query_string, result);\n\n\tif (glob->partition_directory != NULL)\n\t\tDestroyPartitionDirectory(glob->partition_directory);\n\n\treturn result;\n}\n\n", "title": "Core call context: src/backend/optimizer/plan/planner.c:729\u2013743", "paragraphs": []}], "signature": "typedef void (*planner_shutdown_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt);\nextern PGDLLIMPORT planner_shutdown_hook_type planner_shutdown_hook;", "description": ["Hook for plugins to get control before PlannerGlobal is discarded"]}}, "content_hash": "52e88914e0931c6e250c3ebf6ba0fce8b0690ceb3a794dd6b55675780241959a", "imported_at": "2026-09-27T09:57:58.884"}, "snapshot": null, "comparison": {"left": "18", "right": "19", "status": "added", "diff": "--- PostgreSQL 18\n+++ PostgreSQL 19\n@@ -1 +1,22 @@\n-Not recorded in this version\n+{\n+  \"facts\": [\n+    {\n+      \"label\": \"Interface type\",\n+      \"value\": \"planner_shutdown_hook_type\"\n+    },\n+    {\n+      \"label\": \"Header\",\n+      \"value\": \"src/include/optimizer/planner.h\"\n+    },\n+    {\n+      \"label\": \"Subsystem\",\n+      \"value\": \"Query planning\"\n+    },\n+    {\n+      \"label\": \"Initial value\",\n+      \"value\": \"NULL (no hook installed)\"\n+    }\n+  ],\n+  \"signature\": \"typedef void (*planner_shutdown_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt);\\nextern PGDLLIMPORT planner_shutdown_hook_type planner_shutdown_hook;\",\n+  \"tables\": null\n+}"}}