Re: [HACKERS] Bug in gram.y? - Mailing list pgsql-hackers

From Dr. Michael Meskes
Subject Re: [HACKERS] Bug in gram.y?
Date
Msg-id 19980804075231.A3506@feivel.online-club.de
Whole thread Raw
In response to Re: [HACKERS] Bug in gram.y?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Bug in gram.y?  (Bruce Momjian <maillist@candle.pha.pa.us>)
List 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@online-club.de, meskes@debian.org
Go SF49ers! Go Rhein Fire!    Use Debian GNU/Linux!

pgsql-hackers by date:

Previous
From: "Dr. Michael Meskes"
Date:
Subject: Standards question
Next
From: Bruce Momjian
Date:
Subject: Re: [COMMITTERS] 'pgsql/src/include/utils lsyscache.h'