This document summarizes PL/pgSQL internals. PL/pgSQL functions are managed through pg_proc and called via FunctionCallInvoke. PL/pgSQL has predefined handlers for calling, validating, and inlining functions. The lifecycle of a PL/pgSQL function involves registration in pg_proc, compilation, and invocation via the call handler. PL/pgSQL architecture uses PostgreSQL's SQL parser/executor and SPI interface for expression parsing, evaluation, and query execution.