88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.161 2003/07/15 00:11:13 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.162 2003/07/22 23:30:37 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -314,9 +314,15 @@ BootstrapMain(int argc, char *argv[])
314314if (!value )
315315{
316316if (flag == '-' )
317- elog (ERROR ,"--%s requires argument" ,optarg );
317+ ereport (ERROR ,
318+ (errcode (ERRCODE_SYNTAX_ERROR ),
319+ errmsg ("--%s requires a value" ,
320+ optarg )));
318321else
319- elog (ERROR ,"-c %s requires argument" ,optarg );
322+ ereport (ERROR ,
323+ (errcode (ERRCODE_SYNTAX_ERROR ),
324+ errmsg ("-c %s requires a value" ,
325+ optarg )));
320326}
321327
322328SetConfigOption (name ,value ,PGC_POSTMASTER ,PGC_S_ARGV );
@@ -455,7 +461,7 @@ BootstrapMain(int argc, char *argv[])
455461proc_exit (0 );/* done */
456462
457463default :
458- elog (PANIC ,"Unsupported XLOG op %d" ,xlogop );
464+ elog (PANIC ,"unrecognized XLOG op: %d" ,xlogop );
459465proc_exit (0 );
460466}
461467
@@ -566,7 +572,8 @@ boot_openrel(char *relname)
566572if (boot_reldesc != NULL )
567573closerel (NULL );
568574
569- elog (DEBUG4 ,"open relation %s, attrsize %d" ,relname ?relname :"(null)" ,
575+ elog (DEBUG4 ,"open relation %s, attrsize %d" ,
576+ relname ?relname :"(null)" ,
570577 (int )ATTRIBUTE_TUPLE_SIZE );
571578
572579boot_reldesc = heap_openr (relname ,NoLock );
@@ -601,11 +608,11 @@ closerel(char *name)
601608if (boot_reldesc )
602609{
603610if (strcmp (RelationGetRelationName (boot_reldesc ),name )!= 0 )
604- elog (ERROR ,"closerel: close of'%s' when'%s' was expected" ,
611+ elog (ERROR ,"close of%s when%s was expected" ,
605612name ,relname ?relname :"(null)" );
606613}
607614else
608- elog (ERROR ,"closerel: close of'%s' before any relation was opened" ,
615+ elog (ERROR ,"close of%s before any relation was opened" ,
609616name );
610617}
611618
@@ -637,7 +644,7 @@ DefineAttr(char *name, char *type, int attnum)
637644
638645if (boot_reldesc != NULL )
639646{
640- elog (LOG ,"warning: no open relations allowed with'create' command" );
647+ elog (WARNING ,"no open relations allowed withCREATE command" );
641648closerel (relname );
642649}
643650
@@ -770,7 +777,7 @@ InsertOneValue(char *value, int i)
770777
771778AssertArg (i >=0 || i < MAXATTR );
772779
773- elog (DEBUG4 ,"inserting column %d value'%s' " ,i ,value );
780+ elog (DEBUG4 ,"inserting column %d value\"%s\" " ,i ,value );
774781
775782if (Typ != (struct typmap * * )NULL )
776783{
@@ -783,7 +790,7 @@ InsertOneValue(char *value, int i)
783790ap = * app ;
784791if (ap == NULL )
785792{
786- elog (FATAL ,"unable to find atttypid %u in Typ list" ,
793+ elog (FATAL ,"could not find atttypid %u in Typ list" ,
787794boot_reldesc -> rd_att -> attrs [i ]-> atttypid );
788795}
789796values [i ]= OidFunctionCall3 (ap -> am_typ .typinput ,
@@ -875,7 +882,7 @@ cleanup(void)
875882beenhere = 1 ;
876883else
877884{
878- elog (FATAL ,"Memory manager fault: cleanup called twice" );
885+ elog (FATAL ,"cleanup called twice" );
879886proc_exit (1 );
880887}
881888if (boot_reldesc != NULL )
@@ -946,7 +953,7 @@ gettype(char *type)
946953heap_close (rel ,NoLock );
947954return gettype (type );
948955}
949- elog (ERROR ,"Error: unknown type'%s'.\n " ,type );
956+ elog (ERROR ,"unrecognized type\"%s\" " ,type );
950957err_out ();
951958/* not reached, here to make compiler happy */
952959return 0 ;
@@ -962,7 +969,7 @@ AllocateAttribute(void)
962969Form_pg_attribute attribute = (Form_pg_attribute )malloc (ATTRIBUTE_TUPLE_SIZE );
963970
964971if (!PointerIsValid (attribute ))
965- elog (FATAL ,"AllocateAttribute: malloc failed " );
972+ elog (FATAL ,"out of memory " );
966973MemSet (attribute ,0 ,ATTRIBUTE_TUPLE_SIZE );
967974
968975return attribute ;
@@ -1109,14 +1116,8 @@ AddStr(char *str, int strlength, int mderef)
11091116int hashresult ;
11101117int len ;
11111118
1112- if (++ strtable_end == STRTABLESIZE )
1113- {
1114- /* Error, string table overflow, so we Punt */
1115- elog (FATAL ,
1116- "There are too many string constants and identifiers for the compiler to handle." );
1117-
1118-
1119- }
1119+ if (++ strtable_end >=STRTABLESIZE )
1120+ elog (FATAL ,"bootstrap string table overflow" );
11201121
11211122/*
11221123 * Some of the utilites (eg, define type, create relation) assume that