PostgreSQL Databases and Tables

This chapter introduces the operations related to databases and tables in PostgreSQL, including creating and deleting databases, creating and deleting tables, modifying table columns, primary keys, data constraints, and data types.

  1. PostgreSQL Create Databases

    This article describes how to create a new database in PostgreSQL.
  2. PostgreSQL Drop Databases

    PostgreSQL allows you to drop an existing database using the DROP DATABASE statement.
  3. PostgreSQL Alter Databases

    This article describes how to modify a database in PostgreSQL.
  4. PostgreSQL Rename Databases

    This article describes the detailed steps to rename a database in PostgreSQL.
  5. PostgreSQL Create Tables

    This article describes how to create a new table using the CREATE TABLE statement.
  6. PostgreSQL Drop Tables

    This article describes how to use the DROP TABLE statement.
  7. PostgreSQL Alter tables

    This article describes how to use the ALTER TABLE statement to modify an existing table.
  8. PostgreSQL Rename Tables

    This article describes how to rename a table using the ALTER TABLE statement.
  9. PostgreSQL Add Columns

    In this article, you will learn how to add one or more columns to a table using PostgreSQL ALTER TABLE ... ADD COLUMN statements.
  10. PostgreSQL Rename Columns

    In this article, you will learn how to rename one or more columns using PostgreSQL ALTER TABLE ... RENAME COLUMN statements.
  11. PostgreSQL Primary Keys

    In this article, you introduced what a primary key is, its rules, and how to use it in PostgreSQL.
  12. PostgreSQL FOREIGN KEY

    In this article, we introduce what foreign keys are, their rules, and how to use them in PostgreSQL.
  13. PostgreSQL NOT NULL

    PostgreSQL NOT NULL constraints are used to restrict column values ​​from being nullable.
  14. PostgreSQL Generated Columns

    The values of a PostgreSQL generated columns are always automatically calculated from other columns.
  15. PostgreSQL Identity Columns

    PostgreSQL identity columns are used to define a column that can automatically generate unique values.
  16. PostgreSQL CHECK

    In this article, you will learn how to use PostgreSQL CHECK constraints to ensure that data written to a table is correct.
  17. PostgreSQL SEQUENCE

    In this article, we covered how to create, use, and drop sequences in PostgreSQL.
  18. PostgreSQL SELECT INTO

    This article describes how to use the SELECT INTO statement create a new table from a result set.
  19. PostgreSQL Schema

    This article discusses the basic usage of PostgreSQL schemas, including creating schemas, modifying schemas, and dropping schemas.