Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYWTB-0005wB-Eo for pgsql-general@arkaria.postgresql.org; Fri, 30 Oct 2020 15:37:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kYWT8-0002EI-R5 for pgsql-general@arkaria.postgresql.org; Fri, 30 Oct 2020 15:37:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYWT7-0002EB-6g for pgsql-general@lists.postgresql.org; Fri, 30 Oct 2020 15:37:34 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYWT4-0002tJ-Gs for pgsql-general@lists.postgresql.org; Fri, 30 Oct 2020 15:37:32 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 30BD65C03F7; Fri, 30 Oct 2020 11:37:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 30 Oct 2020 11:37:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=L aDe4I/9623K5AgIoKFGco+aRwva2oHPgFeklyybKCQ=; b=Ss4rqVicyzuZ45vjx S9n/iW7BsP+AZpUirtQnsipouGxtIAKkLN/CXPrIq6EIaV3xftmRFcFSkQbm3vb4 WY3SnoNbQJHBCfg72XqvjO+ufCVdCMyCFm31IJhdr0RsLmtTcQwDGXr8w8tYLTtK Fom57SrH3rSFyGYGhOo6fyV1zgNka+rrbnP/n4Kg0mvTjntZcyFlHS9v9bgc+Yuf BhYTcJXJpy3CV0eGbMkZAyLI/LrKkg2e+1ohYXhwyPvrUFrjhlqiSHEcYImfbNiN pbslOmc3Gk54hen26vPfEXDRhXaEXV6wSU3XRrb9Hv/aKbKg0kM7D2aeiHFGHsnE MwWVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=LaDe4I/9623K5AgIoKFGco+aRwva2oHPgFeklyybK CQ=; b=WLP8KvHMxBafZeHROa+IQsNZAG3Q7m5lrIo/NUKfmXIaUQ/cLb0hupUwC lcAaiywvEADXHCxLbjZlRIzzbeKmnG+e+WuqmOEpHbIS3omn1X8xZiGqsbbeuRpT yamqAyN1BvMqaZ3XoYQo31WWQ/g/8os80NzdyBjfxNtfkWaSrPbuKlYDgzPidLYW V8ZCW2SN+sGvTNsFAd1/JJrA55hYNA69F5v2Fo0n2pKlGtT/zB5DEj3AyoF/J/KX bE57LoruAHAUHt0B/h26isOjR4Swg+yxlw41Gim6ISJYdy9nhIvs5bGo/2iHNwFF i7osTHr63Z8AQwW8scOc13qfu2Sig== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrleehgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepteejvdetffejuedvleeifeefheeutdfhgfdvhffhhfek vdduveegvdejudefgfevnecukfhppeejgedrleegrdejfedrvddvvdenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 8BC5F3280060; Fri, 30 Oct 2020 11:37:28 -0400 (EDT) Subject: Re: Drop column constraint To: Rich Shepard , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <6710083f-90d2-d111-45dd-e6f4162f825e@aklaver.com> Date: Fri, 30 Oct 2020 08:37:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/30/20 8:30 AM, Rich Shepard wrote: > A table has a unique constraint on a column that needs removing. Reading > the > postgres-12.x docs for alter table it appears the correct syntax is: > > alter table locations drop constraint unique; It should be: alter table locations drop constraint 'constraint_name'; Where you can find 'constraint_name' from: \d locations > > but this is wrong. > > Trying 'alter table locations alter column loc_nbr drop constraint > unique;' also > failed. > > What's the proper syntax to drop the unique constraint on a table column? > > TIA, > > Rich > > > -- Adrian Klaver adrian.klaver@aklaver.com