opr_charset rule in gram.y

From: Neha Khatri <nehakhatri5(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: opr_charset rule in gram.y
Date: 2017-03-07 04:54:31
Message-ID: CAFO0U+-iOS5oYN5v3SBuZvfhPUTRrkDFEx8w7H17B07Rwg3YUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-novice

Hi,

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-03-07 04:55:00 Re: WARNING: relcache reference leak: relation "p1" not closed
Previous Message Ashutosh Sharma 2017-03-07 04:52:45 Re: Parallel seq. plan is not coming against inheritance or partition table

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2017-03-07 05:30:13 Re: [NOVICE] opr_charset rule in gram.y
Previous Message Neha Khatri 2017-02-27 01:53:15 Re: Make INFO messages consistent in various index *validate() functions