2 Chapter 41. PL/pgSQL — SQL Procedural Language
8 41.1.1. Advantages of Using PL/pgSQL
9 41.1.2. Supported Argument and Result Data Types
11 41.2. Structure of PL/pgSQL
14 41.3.1. Declaring Function Parameters
19 41.3.6. Collation of PL/pgSQL Variables
22 41.5. Basic Statements
25 41.5.2. Executing SQL Commands
26 41.5.3. Executing a Command with a Single-Row Result
27 41.5.4. Executing Dynamic Commands
28 41.5.5. Obtaining the Result Status
29 41.5.6. Doing Nothing At All
31 41.6. Control Structures
33 41.6.1. Returning from a Function
34 41.6.2. Returning from a Procedure
35 41.6.3. Calling a Procedure
38 41.6.6. Looping through Query Results
39 41.6.7. Looping through Arrays
40 41.6.8. Trapping Errors
41 41.6.9. Obtaining Execution Location Information
45 41.7.1. Declaring Cursor Variables
46 41.7.2. Opening Cursors
48 41.7.4. Looping through a Cursor's Result
50 41.8. Transaction Management
51 41.9. Errors and Messages
53 41.9.1. Reporting Errors and Messages
54 41.9.2. Checking Assertions
56 41.10. Trigger Functions
58 41.10.1. Triggers on Data Changes
59 41.10.2. Triggers on Events
61 41.11. PL/pgSQL under the Hood
63 41.11.1. Variable Substitution
66 41.12. Tips for Developing in PL/pgSQL
68 41.12.1. Handling of Quotation Marks
69 41.12.2. Additional Compile-Time and Run-Time Checks
71 41.13. Porting from Oracle PL/SQL
73 41.13.1. Porting Examples
74 41.13.2. Other Things to Watch For