↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Supported versions: Current (18) / 17 / 16 / 15 / 14
Development versions: 19 / devel
Unsupported versions: 13 / 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0

46.4. Anonymous Code Blocks #

PL/Python also supports anonymous code blocks called with the DO statement:

DO $$
    # PL/Python code
$$ LANGUAGE plpython3u;

An anonymous code block receives no arguments, and whatever value it might return is discarded. Otherwise it behaves just like a function.

Report a documentation issue

Read the upstream documentation. Report corrections through the PostgreSQL documentation form.