Control structures are ways to regulate the data. Control structures are important because they:

  • Are very useful in writing code that gives flexibility to the programmer.

  • Can be used to manipulate the PostgreSQL data by using logic to specify what should be done when a user tries to change or modify the data.

  • Gives power to the programmer because the programmer can specify when a situation occurs, the function should do this or that.

There are two different types of control structures. The first type is the IF statement. IF statements can give the user control over the action that occurs when a condition exists. The second type is the iterative loop. Iterative loops allow the user to repeatedly perform an action for a true condition.