Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf3ee8a

Browse files
committed
Add some notes about why "ALTER TYPE enum DROP VALUE" is hard.
In hopes of putting these where any would-be implementer is sure tofind them, make a placeholder grammar production for ALTER DROP VALUEand put them there. This is really just a docs patch, though.Vik Fearing, with a bit more wordsmithing by meDiscussion:https://postgr.es/m/9fffd149-da0f-0c9c-6745-731fb688642a@postgresfriends.org
1 parentc2ba3fd commitaf3ee8a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

‎src/backend/parser/gram.y

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6412,6 +6412,33 @@ AlterEnumStmt:
64126412
n->skipIfNewValExists =false;
64136413
$$ = (Node *) n;
64146414
}
6415+
|ALTERTYPE_Pany_nameDROPVALUE_PSconst
6416+
{
6417+
/*
6418+
* The following problems must be solved before this can be
6419+
* implemented:
6420+
*
6421+
* - There must be no instance of the target value in
6422+
* any table.
6423+
*
6424+
* - The value must not appear in any catalog metadata,
6425+
* such as stored view expressions or column defaults.
6426+
*
6427+
* - The value must not appear in any non-leaf page of a
6428+
* btree (and similar issues with other index types).
6429+
* This is problematic because a value could persist
6430+
* there long after it's gone from user-visible data.
6431+
*
6432+
* - Concurrent sessions must not be able to insert the
6433+
* value while the preceding conditions are being checked.
6434+
*
6435+
* - Possibly more...
6436+
*/
6437+
ereport(ERROR,
6438+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
6439+
errmsg("dropping an enum value is not implemented"),
6440+
parser_errposition(@4)));
6441+
}
64156442
;
64166443

64176444
opt_if_not_exists:IF_PNOTEXISTS {$$ =true; }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp