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 1lbaKG-0005kT-5p for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Apr 2021 02:53:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lbaKE-0001lL-6e for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Apr 2021 02:53:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbaKD-0001lC-IV for pgsql-hackers@lists.postgresql.org; Wed, 28 Apr 2021 02:53:18 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lbaK6-0007bX-IF for pgsql-hackers@postgresql.org; Wed, 28 Apr 2021 02:53:17 +0000 Received: by fetter.org (Postfix, from userid 1001) id B684C40CBF; Wed, 28 Apr 2021 04:53:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fetter.org; s=default; t=1619578388; bh=NbkL0i7RxOVhwO481/RT0aQXjfUtJYxE8yF+g8uVYYc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZAWEaoizvYrOcd7enSQNCy+9fj66g4sle539zPYU2BmwFhZP2ld8yqecjLt8FLWMC t2lBgk9BYUzuvHPzWQkZVtrNGT51z5bZ+451T54Wag/L/BDwSEqCoJgHEYPueFwE/O dFZZVgCEQ6ZDe0DHF80QJN7GmXlowaPWvUnyFCoQ9avgEM0FjamN/RRe+5FenSBWPj C9MWDo0zP0u2R6m5omFIQhra+MqxAqgbjdWrOtQu7f0XV5a7GFWbGt+05x9h/xTW/8 ub8DIY3YG5uOdQM0GEHIiQ0UjhjqlbTGDFAp/+pXIwxuA0EzDvk8PxUbjaXCmzsw9Y gy/BS+it2xgVQ== Date: Wed, 28 Apr 2021 02:53:08 +0000 From: David Fetter To: Aleksander Alekseev Cc: PostgreSQL Development Subject: Re: Bug fix for tab completion of ALTER TABLE ... VALIDATE CONSTRAINT ... Message-ID: <20210428025308.GC17834@fetter.org> References: <20210427002433.GB17834@fetter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 27, 2021 at 12:33:25PM +0300, Aleksander Alekseev wrote: > Hi David, > > > I noticed that $subject completes with already valid constraints, > > please find attached a patch that fixes it. I noticed that there are > > other places constraints can be validated, but didn't check whether > > similar bugs exist there yet. > > There was a typo in the patch ("... and and not convalidated"). I've fixed > it. Otherwise the patch passes all the tests and works as expected: > > eax=# create table foo (x int); > CREATE TABLE > eax=# alter table foo add constraint bar check (x < 3) not valid; > ALTER TABLE > eax=# alter table foo add constraint baz check (x <> 5) not valid; > ALTER TABLE > eax=# alter table foo validate constraint ba > bar baz > eax=# alter table foo validate constraint bar; > ALTER TABLE Sorry about that typo, and thanks for poking at this! Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate