pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Unique index
Date: Wed, 20 Sep 2023 16:14:52 +0200
Message-ID: <3983831447229a17fc9028fd2f5b2aaf0996c291.camel@cybertec.at> (raw)
In-Reply-To: <CAJk5AtZyVr7xeOQrxo1HGYePMK9o_+Pt9OdkHT1w_p6ywHS-qg@mail.gmail.com>
References: <CAJk5AtZyVr7xeOQrxo1HGYePMK9o_+Pt9OdkHT1w_p6ywHS-qg@mail.gmail.com>

On Wed, 2023-09-20 at 19:16 +0530, Rajesh Kumar wrote:
> Why unique index is used over unique constraints?

A unique constraint is implemented by a unique index.
If you create the constraint, the index is created automatically.
You cannot drop the index unless you drop the constraint.

Yours,
Laurenz Albe





view thread (4+ messages)  latest in thread

Message-ID: <3983831447229a17fc9028fd2f5b2aaf0996c291.camel@cybertec.at>
Permalink:  ../3983831447229a17fc9028fd2f5b2aaf0996c291.camel@cybertec.at/
Also on:    postgresql.org/message-id/3983831447229a17fc9028fd2f5b2aaf0996c291.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, rajeshkumar.dba09@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Unique index
  In-Reply-To: <3983831447229a17fc9028fd2f5b2aaf0996c291.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox