Mano
Mano

Reputation: 711

Oracle Primary Key to Postgres

I'm migrating tables from Oracle to Postgres.

When a Primary key is created on an Oracle table, it implicitly creates a unique index with the same name. But there is no such index created in Postgres or it is not visible in data dictionary tables.

Postgres doesn't allow creating an index with the Primary key name. I want to know if a unique index is required in Postgres on the primary key column. Does it by any way alter query performance if I do not create unique index for primary key column? Thanks in advance.

Upvotes: 0

Views: 371

Answers (1)

Adrian Klaver
Adrian Klaver

Reputation: 19724

That is not correct:

create table pk_test (id integer primary key);

 \d pk_test
              Table "public.pk_test"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 id     | integer |           | not null | 
Indexes:
    "pk_test_pkey" PRIMARY KEY, btree (id)

Upvotes: 3

Related Questions