Skip to content

INITIALLY

CREATE TABLE persons (
person_id INT,
last_name VARCHAR(255) NOT NULL,
first_name VARCHAR(255),
city VARCHAR(255),
CONSTRAINT pk_persons PRIMARY KEY (person_id)
) INITIALLY DEFERRED;
Table PERSONS created.

In this example, the INITIALLY DEFERRED option is used in the CREATE TABLE statement. It creates a table named ‘persons’ with some columns. INITIALLY DEFERRED ensures that all constraints (like the PRIMARY KEY constraint here) are checked only at the transaction’s end, not after every statement. While this example does not demonstrate deferral in action, it sets up a condition where it could be seen if multiple operations were performed within a transaction.