From d6fd85b2142a6ba30da03b85b93ef3563e92eec8 Mon Sep 17 00:00:00 2001 From: Rushabh Lathia Date: Thu, 27 Feb 2025 15:22:56 +0530 Subject: [PATCH 3/3] Documentation changes --- doc/src/sgml/catalogs.sgml | 5 +++-- doc/src/sgml/ref/alter_table.sgml | 4 ++-- src/bin/psql/tab-complete.in.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index fb050635551..d6066d7dba1 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1257,10 +1257,11 @@ - attnotnull bool + attnotnull char - This column has a not-null constraint. + The value 't' indicates that a not-null constraint exists for the + column, 'i' for an invalid constraint and 'f' for none. diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index dceb7a7593c..288cd3339f8 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -99,7 +99,7 @@ WITH ( MODULUS numeric_literal, REM and column_constraint is: [ CONSTRAINT constraint_name ] -{ NOT NULL [ NO INHERIT ] | +{ NOT NULL [ NOT VALID ] [ NO INHERIT ] | NULL | CHECK ( expression ) [ NO INHERIT ] | DEFAULT default_expr | @@ -458,7 +458,7 @@ WITH ( MODULUS numeric_literal, REM This form adds a new constraint to a table using the same constraint syntax as CREATE TABLE, plus the option NOT - VALID, which is currently only allowed for foreign key + VALID, which is currently only allowed for foreign key, NOT NULL constraints and CHECK constraints. diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c index 8432be641ac..1c3295d949a 100644 --- a/src/bin/psql/tab-complete.in.c +++ b/src/bin/psql/tab-complete.in.c @@ -2728,7 +2728,7 @@ match_previous_words(int pattern_id, COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes); /* ALTER TABLE xxx ADD CONSTRAINT yyy */ else if (Matches("ALTER", "TABLE", MatchAny, "ADD", "CONSTRAINT", MatchAny)) - COMPLETE_WITH("CHECK", "UNIQUE", "PRIMARY KEY", "EXCLUDE", "FOREIGN KEY"); + COMPLETE_WITH("CHECK", "UNIQUE", "PRIMARY KEY", "EXCLUDE", "FOREIGN KEY", "NOT NULL"); /* ALTER TABLE xxx ADD [CONSTRAINT yyy] (PRIMARY KEY|UNIQUE) */ else if (Matches("ALTER", "TABLE", MatchAny, "ADD", "PRIMARY", "KEY") || Matches("ALTER", "TABLE", MatchAny, "ADD", "UNIQUE") || -- 2.43.0