Overview
ISO/IEC 9075-4:2023 - Information technology - Database languages SQL - Part 4: Persistent stored modules (SQL/PSM) - is the international standard that defines the language elements, semantics and conformance rules for persistent stored modules (procedures, functions, triggers and related program units) within the SQL family. The seventh edition (2023) formalizes the syntax, execution model, diagnostics and metadata views that support creation, invocation and management of SQL-based stored routines.
Key topics and technical scope
This edition organizes comprehensive technical coverage, including:
- Concepts and notations: SQL-server modules, SQL-schemas, base and temporary tables, SQL-invoked routines, cursors, diagnostics and condition handling.
- Lexical elements and expressions: tokens, identifiers, scalar expressions, query expressions and variable references.
- Control and procedural elements: compound statements, control statements (IF, CASE, LOOP, WHILE, FOR, etc.), handlers, condition declarations and variable declarations.
- Dynamic and embedded SQL: rules for preparing and executing dynamic SQL, embedded SQL host programs and direct invocation contexts.
- Schema definition & manipulation: DDL elements for modules, tables, columns, views, triggers and related DROP/CREATE semantics.
- Access control and security: GRANT/REVOKE semantics for module-level privileges and role-based module grants.
- Diagnostics & status codes: GET DIAGNOSTICS, SIGNAL/RESIGNAL and SQLSTATE status code definitions.
- Metadata (InformationSchema & DefinitionSchema): standardized views and base tables such as MODULES, ROUTINES, PARAMETERS, MODULE_COLUMN_USAGE, MODULE_PRIVILEGES, MODULE_TABLE_USAGE and ROLE_MODULE_GRANTS for introspection and tooling.
- Conformance: conformance claims, optional feature taxonomy and annexes covering implementation-defined and deprecated elements.
Practical applications and target users
ISO/IEC 9075-4:2023 is intended for anyone implementing or using SQL stored programs:
- DBMS vendors and implementers - ensure compliant stored-procedure engines, dynamic SQL handling and metadata exposure.
- Application developers and database developers - write portable stored procedures, functions and triggers consistent with the SQL standard.
- DBAs and architects - design secure, maintainable module deployments and manage privileges and schema objects.
- Tooling and ORM vendors - support standardized information schema views and diagnostics for introspection, migration and code generation.
- Auditors and QA teams - verify conformance, error handling and security behavior against a recognized international standard.
Related standards
- Part of the ISO/IEC 9075 (SQL) family - this document complements other parts of the SQL standard that define core query language, data types and additional SQL features.
Keywords: ISO/IEC 9075-4:2023, SQL/PSM, Persistent Stored Modules, SQL standard, stored procedures, dynamic SQL, information schema, MODULES view, SQLSTATE.