Implicit index is created when creating a table for a primary key : Primary Key « Constraints « PostgreSQL






Implicit index is created when creating a table for a primary key


postgres=#
postgres=# CREATE TABLE authors (id integer PRIMARY KEY,
postgres(#                       last_name text,
postgres(#                       first_name text);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "authors_pkey" for table "authors"
CREATE TABLE
postgres=#
postgres=# drop table authors;
DROP TABLE
postgres=#
           
       








Related examples in the same category

1.Primary keys constrains more than one column
2.Indicate one column as the primary key column
3.PRIMARY KEY will create implicit index
4.Primary key with check option
5.Add PRIMARY KEY in table creation
6.Use sequence value as a primary key