Databases

Different Types of Constraints in PostgreSQL

Different Types of Constraints¶ Let us understand details about different types of constraints used in RDBMS databases. Supported constraints: NOT NULL constraint CHECK constraint UNIQUE constraint PRIMARY KEY constraint FOREIGN KEY constraint All constraints can be added while creating the table or on pre-created tables using ALTER. Typically we define NOT NULL, CHECK constraints while …

Different Types of Constraints in PostgreSQL Read More »

Overview of Data Types

Overview of Data Types¶ Let us get an overview of supported datatypes in Postgres. Here is the sample CREATE TABLE command for the review. CREATE TABLE users ( user_id SERIAL PRIMARY KEY, user_first_name VARCHAR(30) NOT NULL, user_last_name VARCHAR(30) NOT NULL, user_email_id VARCHAR(50) NOT NULL, user_email_validated BOOLEAN DEFAULT FALSE, user_password VARCHAR(200), user_role VARCHAR(1) NOT NULL DEFAULT …

Overview of Data Types Read More »