diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/tablecmds.c | 2 | ||||
-rw-r--r-- | src/backend/parser/gram.y | 1 | ||||
-rw-r--r-- | src/bin/psql/tab-complete.c | 2 | ||||
-rw-r--r-- | src/test/regress/expected/alter_table.out | 2 | ||||
-rw-r--r-- | src/test/regress/sql/alter_table.sql | 2 |
5 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 6007e10730a..fc4bd0de91a 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -19311,6 +19311,8 @@ GetAttributeStorage(Oid atttypid, const char *storagemode) cstorage = TYPSTORAGE_EXTENDED; else if (pg_strcasecmp(storagemode, "main") == 0) cstorage = TYPSTORAGE_MAIN; + else if (pg_strcasecmp(storagemode, "default") == 0) + cstorage = get_typstorage(atttypid); else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 2dddd8f302c..2a910ded15e 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3758,6 +3758,7 @@ opt_column_compression: column_storage: STORAGE ColId { $$ = $2; } + | STORAGE DEFAULT { $$ = pstrdup("default"); } ; opt_column_storage: diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 4c45e4747a9..7b73886ce19 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2420,7 +2420,7 @@ psql_completion(const char *text, int start, int end) /* ALTER TABLE ALTER [COLUMN] <foo> SET STORAGE */ else if (Matches("ALTER", "TABLE", MatchAny, "ALTER", "COLUMN", MatchAny, "SET", "STORAGE") || Matches("ALTER", "TABLE", MatchAny, "ALTER", MatchAny, "SET", "STORAGE")) - COMPLETE_WITH("PLAIN", "EXTERNAL", "EXTENDED", "MAIN"); + COMPLETE_WITH("DEFAULT", "PLAIN", "EXTERNAL", "EXTENDED", "MAIN"); /* ALTER TABLE ALTER [COLUMN] <foo> SET STATISTICS */ else if (Matches("ALTER", "TABLE", MatchAny, "ALTER", "COLUMN", MatchAny, "SET", "STATISTICS") || Matches("ALTER", "TABLE", MatchAny, "ALTER", MatchAny, "SET", "STATISTICS")) diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index ca13f0c13ac..600e603bdfa 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -2262,7 +2262,7 @@ select reltoastrelid <> 0 as has_toast_table f (1 row) -alter table test_storage alter a set storage extended; -- re-add TOAST table +alter table test_storage alter a set storage default; -- re-add TOAST table select reltoastrelid <> 0 as has_toast_table from pg_class where oid = 'test_storage'::regclass; has_toast_table diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index b85b6c73989..f58b2f75d5b 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -1535,7 +1535,7 @@ alter table test_storage alter a set storage plain; alter table test_storage add b int default random()::int; select reltoastrelid <> 0 as has_toast_table from pg_class where oid = 'test_storage'::regclass; -alter table test_storage alter a set storage extended; -- re-add TOAST table +alter table test_storage alter a set storage default; -- re-add TOAST table select reltoastrelid <> 0 as has_toast_table from pg_class where oid = 'test_storage'::regclass; |