The PostgreSQL control statements are an essential part of the PL/pgSQL language; they enable developers to code very complex business logic inside of PostgreSQL.
The PostgreSQL PL/pgSQL control statements
Declaration statements
A declaration statement allows the developer to define variables and constants. The general syntax of a variable declaration is as follows:
name [ CONSTANT ] type [ COLLATE collation_name ] [ NOT NULL ] [ { DEFAULT | := | = } expression ];
The description is as follows:
- name: The name should follow the naming rules that were discussed in Chapter 3, PostgreSQL Basic Building Blocks. For example, the name should not start with an integer.
- CONSTANT: The variable cannot be assigned another value after...