Re: [HACKERS] Bug in gram.y?

From: "Dr(dot) Michael Meskes" <meskes(at)online-club(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Bug in gram.y?
Date: 1998-08-04 05:52:31
Message-ID: 19980804075231.A3506@feivel.online-club.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 03, 1998 at 02:19:44PM -0400, Bruce Momjian wrote:
> Looks fine to me:
>
> opt_database1: LOCATION '=' location { $$ = $3; }
> | /*EMPTY*/ { $$ = NULL; }
> ;
>
> opt_database2: ENCODING '=' encoding { $$ = $3; }
> | /*EMPTY*/ { $$ = NULL; }
> ;

Yes, but check the code under CreatedbStmt:

n->dbpath = $5;
#ifdef MULTIBYTE
if ($6 != NULL) {
n->encoding = pg_char_to_encoding($6);
if (n->encoding < 0) {
elog(ERROR, "invalid encoding name %s", $6);
}
} else {
n->encoding = GetTemplateEncoding();
}
#else
elog(ERROR, "WITH ENCODING is not supported");
#endif
$$ = (Node *)n;

If you have undefined MULTIBYTE you will get the WITH ENCODING error message
despite the command being legal even without this option.

Michael
--
Dr. Michael Meskes meskes(at)online-club(dot)de, meskes(at)debian(dot)org
Go SF49ers! Go Rhein Fire! Use Debian GNU/Linux!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 1998-08-04 10:07:54 How do I construct a varlena?
Previous Message Bruce Momjian 1998-08-04 04:51:58 EXPLAIN VERBOSE