Re: Bug fix for tab completion of ALTER TABLE ... VALIDATE CONSTRAINT ...
Aleksander Alekseev <aleksander@timescale.com>
From: Aleksander Alekseev <aleksander@timescale.com>
To: David Fetter <david@fetter.org>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2021-04-27T09:33:25Z
Lists: pgsql-hackers
Attachments
- v2-0001-tab-completion-of-ALTER-TABLE.VALIDATE-CONSTRAINT.patch (application/octet-stream) patch v2-0001
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
--
Best regards,
Aleksander Alekseev
Commits
-
Tab completion: don't offer valid constraints in VALIDATE CONSTRAINT.
- dfe67c0e85a5 15.0 landed