跳转到主要内容

pg_toastinspect

低层检查 TOAST 分块标识、尺寸与存储值。

pg_toastinspect · 低层检查 TOAST 分块标识、尺寸与存储值。

概览

ID扩展软件包版本类别许可证编程语言
101934pg_toastinspectpg_toastinspect1.0ADMINPostgreSQLC

用法

来源:

pg_toastinspect 低层检查 TOAST 分块标识、尺寸与存储值。

启用

为目标服务器安装文件,然后在目标数据库中创建 pg_toastinspect:

CREATE EXTENSION pg_toastinspect;

核心流程

以下示例取自经审查的上游文档。使用前应调整对象名、路径、凭据与工作负载参数。

-- Get the chunk ID of a TOASTed value
SELECT ctid, id, get_toast_chunk_id(response_content), response_content
FROM ai_call_log_copy1
WHERE id = 668310181431480320;

-- Get complete TOAST information
SELECT ctid, id, get_toast_info(response_content), response_content
FROM ai_call_log_copy1
WHERE id = 668310181431480320;

-- Access individual fields from the composite type
SELECT
    ctid,
    id,
    (get_toast_info(response_content)).raw_size,
    (get_toast_info(response_content)).ext_size,
    (get_toast_info(response_content)).chunk_id,
    (get_toast_info(response_content)).reltoastrelid
FROM ai_call_log_copy1
WHERE id = 668310181431480320;

主要对象

经审查的安装接口包含以下主要对象:

对象类型运维作用
get_toast_infoFUNCTION经审查安装接口中的可调用函数。
get_toast_chunk_idFUNCTION经审查安装接口中的可调用函数。
toast_pointer_infoTYPE扩展创建的用户数据类型。

运维与边界

  • 应将扩展升级视为数据库变更:先审查上游升级路径、权限、锁以及备份恢复行为。

表格阅读器