I was going through the grammer rule for Character types in gram.y and found an optional sub rule in is "opt_charset"
CharacterWithLength: character '(' Iconst ')' opt_charset
{
if (($5 != NULL) && (strcmp($5, "sql_text") != 0))
$1 = psprintf("%s_%s", $1, $5);
$$ = SystemTypeName($1);
I would like to understand how opt_charset would get used in real applications. I tried to make use of it but results in failure:
postgres=# create table testchar (c1 char(5) character set utf8);
ERROR: type "pg_catalog.bpchar_utf8" does not exist
LINE 1: create table testchar (c1 char(5) character set utf8);
There does not seem to be any documentation available about this optional parameter in the documents for Character data type( at least I could not find any).
Any inputs on this are appreciated.
Regards,
Neha