I happened to notice that we have dead code to parse floating point
numbers in the boostrap scanner/parser. This seems unused since forever
-- or, more precisely, I couldn't find any floats in 8.2's postgres.bki
(the oldest I have around). I would just rip it out, per the attached.
--
Álvaro Herrera
diff --git a/src/backend/bootstrap/bootparse.y
b/src/backend/bootstrap/bootparse.y
index d28af23..33d9f0b 100644
--- a/src/backend/bootstrap/bootparse.y
+++ b/src/backend/bootstrap/bootparse.y
@@ -105,11 +105,11 @@ static int num_columns_read = 0;
%type boot_index_params
%type boot_index_param
-%typeboot_const boot_ident
+%typeboot_ident
%type optbootstrap optsharedrelation optwithoutoids
boot_column_nullness
%type oidspec optoideq optrowtypeoid
-%token CONST_P ID
+%token ID
%token OPEN XCLOSE XCREATE INSERT_TUPLE
%token XDECLARE INDEX ON USING XBUILD INDICES UNIQUE XTOAST
%token COMMA EQUALS LPAREN RPAREN
@@ -464,16 +464,10 @@ boot_column_val_list:
boot_column_val:
boot_ident
{ InsertOneValue($1, num_columns_read++); }
- | boot_const
- { InsertOneValue($1, num_columns_read++); }
| NULLVAL
{ InsertOneNull(num_columns_read++); }
;
-boot_const :
- CONST_P { $$ = yylval.str; }
- ;
-
boot_ident :
ID{ $$ = yylval.str; }
;
diff --git a/src/backend/bootstrap/bootscanner.l
b/src/backend/bootstrap/bootscanner.l
index 9cfd19c..6467882 100644
--- a/src/backend/bootstrap/bootscanner.l
+++ b/src/backend/bootstrap/bootscanner.l
@@ -66,7 +66,6 @@ static intyyline = 1; /* line number
for error reporting */
D [0-9]
oct\\{D}{D}{D}
-Exp[Ee][-+]?{D}+
id ([A-Za-z0-9_]|{oct}|\-)+
sid\"([^\"])*\"
arrayid [A-Za-z0-9_]+\[{D}*\]
@@ -127,13 +126,6 @@ insert { return(INSERT_TUPLE); }
return(ID);
}
-(-)?{D}+"."{D}*({Exp})? |
-(-)?{D}*"."{D}+({Exp})? |
-(-)?{D}+{Exp} {
- yylval.str =
pstrdup(yytext);
- return(CONST_P);
- }
-
. {
elog(ERROR, "syntax error at line %d:
unexpected character \"%s\"", yyline, yytext);
}
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers