Re: BUG #14121: Constraint UNIQUE

From: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>
To: m(dot)giraldo(at)stt-telefonia(dot)it
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14121: Constraint UNIQUE
Date: 2016-04-29 14:47:29
Message-ID: CAAJSdjjYzrNQfKTodQSf85BV+ijxz1Y9QH6ghyO4aS30KYR=vA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Apr 29, 2016 at 5:35 AM, <m(dot)giraldo(at)stt-telefonia(dot)it> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 14121
> Logged by: Marco
> Email address: m(dot)giraldo(at)stt-telefonia(dot)it
> PostgreSQL version: 9.5.0
> Operating system: Windows 7
> Description:
>
> Hi
> I have a problem with UNIQUE constraint.
> I don't understand the difference from TYPE type UNIQUE(when I declare a
> column of the table) and ALTER TABLE table ADD CONSTRAINT column UNIQUE
> (column).
> How can I remove the UNIQUE option from TYPE declaration?
>
> Best reguards
>

​ALTER TABLE table DROP CONSTRAINT constraint_name;

Example:

# create table c(c text unique);

CREATE TABLE

# \d+ c
Table "public.c"

Column | Type | Modifiers | Storage | Stats target | Description

--------+------+-----------+----------+--------------+-------------

c | text | | extended | |

Indexes:

"c_c_key" UNIQUE CONSTRAINT, btree (c)

# alter table c drop constraint c_c_key;
ALTER TABLE
# \d+ c
Table "public.c"
Column | Type | Modifiers | Storage | Stats target | Description
--------+------+-----------+----------+--------------+-------------
c | text | | extended | |

--
The unfacts, did we have them, are too imprecisely few to warrant our
certitude.

Maranatha! <><
John McKown

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2016-04-29 15:59:26 Re: BUG #14121: Constraint UNIQUE
Previous Message Mathias Kunter 2016-04-29 12:15:38 Re: BUG #14107: Major query planner bug regarding subqueries and indices