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

Commit11324e4

Browse files
committed
Remove vestigial grammar support for CHARACTER ... CHARACTER SET option.
The SQL standard says that you should be able to write "CHARACTER SET foo"as part of the declaration of a char-type column. We don't implement that,but a rough form of support has existed in gram.y since commitf10b639.That's now sat there for nigh 20 years without anyone fleshing it out ---and even if someone did, the contemplated approach of having separate datatype name(s) for every character set certainly isn't what we'd do today.Let's just remove the grammar production; if anyone is ever motivated towork on this, reinventing the grammar support is a trivial fraction ofwhat they'd have to do. And we've never documented anything aboutsupporting such a clause.Per gripe from Neha Khatri.Discussion:https://postgr.es/m/CAFO0U+-iOS5oYN5v3SBuZvfhPUTRrkDFEx8w7H17B07Rwg3YUA@mail.gmail.com
1 parenta71f101 commit11324e4

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

‎src/backend/parser/gram.y

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
513513
BitConstBitBitWithLengthBitWithoutLength
514514
%type<str>character
515515
%type<str>extract_arg
516-
%type<str>opt_charset
517516
%type<boolean>opt_varyingopt_timezoneopt_no_inherit
518517

519518
%type<ival>IconstSignedIconst
@@ -11923,28 +11922,20 @@ ConstCharacter: CharacterWithLength
1192311922
}
1192411923
;
1192511924

11926-
CharacterWithLength:character'('Iconst')'opt_charset
11925+
CharacterWithLength:character'('Iconst')'
1192711926
{
11928-
if (($5 !=NULL) && (strcmp($5,"sql_text") !=0))
11929-
$1 = psprintf("%s_%s",$1,$5);
11930-
1193111927
$$ = SystemTypeName($1);
1193211928
$$->typmods = list_make1(makeIntConst($3,@3));
1193311929
$$->location =@1;
1193411930
}
1193511931
;
1193611932

11937-
CharacterWithoutLength:characteropt_charset
11933+
CharacterWithoutLength:character
1193811934
{
11939-
if (($2 !=NULL) && (strcmp($2,"sql_text") !=0))
11940-
$1 = psprintf("%s_%s",$1,$2);
11941-
1194211935
$$ = SystemTypeName($1);
11943-
1194411936
/* char defaults to char(1), varchar to no limit*/
1194511937
if (strcmp($1,"bpchar") ==0)
1194611938
$$->typmods = list_make1(makeIntConst(1, -1));
11947-
1194811939
$$->location =@1;
1194911940
}
1195011941
;
@@ -11968,11 +11959,6 @@ opt_varying:
1196811959
|/*EMPTY*/{$$ =FALSE; }
1196911960
;
1197011961

11971-
opt_charset:
11972-
CHARACTERSETColId{$$ =$3; }
11973-
|/*EMPTY*/{$$ =NULL; }
11974-
;
11975-
1197611962
/*
1197711963
* SQL date/time types
1197811964
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp