8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -314,9 +314,15 @@ BootstrapMain(int argc, char *argv[])
314
314
if (!value )
315
315
{
316
316
if (flag == '-' )
317
- elog (ERROR , "--%s requires argument" , optarg );
317
+ ereport (ERROR ,
318
+ (errcode (ERRCODE_SYNTAX_ERROR ),
319
+ errmsg ("--%s requires a value" ,
320
+ optarg )));
318
321
else
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 )));
320
326
}
321
327
322
328
SetConfigOption (name , value , PGC_POSTMASTER , PGC_S_ARGV );
@@ -455,7 +461,7 @@ BootstrapMain(int argc, char *argv[])
455
461
proc_exit (0 ); /* done */
456
462
457
463
default :
458
- elog (PANIC , "Unsupported XLOG op %d" , xlogop );
464
+ elog (PANIC , "unrecognized XLOG op: %d" , xlogop );
459
465
proc_exit (0 );
460
466
}
461
467
@@ -566,7 +572,8 @@ boot_openrel(char *relname)
566
572
if (boot_reldesc != NULL )
567
573
closerel (NULL );
568
574
569
- elog (DEBUG4 , "open relation %s, attrsize %d" , relname ? relname : "(null)" ,
575
+ elog (DEBUG4 , "open relation %s, attrsize %d" ,
576
+ relname ? relname : "(null)" ,
570
577
(int ) ATTRIBUTE_TUPLE_SIZE );
571
578
572
579
boot_reldesc = heap_openr (relname , NoLock );
@@ -601,11 +608,11 @@ closerel(char *name)
601
608
if (boot_reldesc )
602
609
{
603
610
if (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" ,
605
612
name , relname ? relname : "(null)" );
606
613
}
607
614
else
608
- elog (ERROR , "closerel: close of '%s' before any relation was opened" ,
615
+ elog (ERROR , "close of %s before any relation was opened" ,
609
616
name );
610
617
}
611
618
@@ -637,7 +644,7 @@ DefineAttr(char *name, char *type, int attnum)
637
644
638
645
if (boot_reldesc != NULL )
639
646
{
640
- elog (LOG , "warning: no open relations allowed with 'create' command" );
647
+ elog (WARNING , "no open relations allowed with CREATE command" );
641
648
closerel (relname );
642
649
}
643
650
@@ -770,7 +777,7 @@ InsertOneValue(char *value, int i)
770
777
771
778
AssertArg (i >= 0 || i < MAXATTR );
772
779
773
- elog (DEBUG4 , "inserting column %d value '%s' " , i , value );
780
+ elog (DEBUG4 , "inserting column %d value \"%s\" " , i , value );
774
781
775
782
if (Typ != (struct typmap * * ) NULL )
776
783
{
@@ -783,7 +790,7 @@ InsertOneValue(char *value, int i)
783
790
ap = * app ;
784
791
if (ap == NULL )
785
792
{
786
- elog (FATAL , "unable to find atttypid %u in Typ list" ,
793
+ elog (FATAL , "could not find atttypid %u in Typ list" ,
787
794
boot_reldesc -> rd_att -> attrs [i ]-> atttypid );
788
795
}
789
796
values [i ] = OidFunctionCall3 (ap -> am_typ .typinput ,
@@ -875,7 +882,7 @@ cleanup(void)
875
882
beenhere = 1 ;
876
883
else
877
884
{
878
- elog (FATAL , "Memory manager fault: cleanup called twice" );
885
+ elog (FATAL , "cleanup called twice" );
879
886
proc_exit (1 );
880
887
}
881
888
if (boot_reldesc != NULL )
@@ -946,7 +953,7 @@ gettype(char *type)
946
953
heap_close (rel , NoLock );
947
954
return gettype (type );
948
955
}
949
- elog (ERROR , "Error: unknown type '%s'.\n " , type );
956
+ elog (ERROR , "unrecognized type \"%s\" " , type );
950
957
err_out ();
951
958
/* not reached, here to make compiler happy */
952
959
return 0 ;
@@ -962,7 +969,7 @@ AllocateAttribute(void)
962
969
Form_pg_attribute attribute = (Form_pg_attribute ) malloc (ATTRIBUTE_TUPLE_SIZE );
963
970
964
971
if (!PointerIsValid (attribute ))
965
- elog (FATAL , "AllocateAttribute: malloc failed " );
972
+ elog (FATAL , "out of memory " );
966
973
MemSet (attribute , 0 , ATTRIBUTE_TUPLE_SIZE );
967
974
968
975
return attribute ;
@@ -1109,14 +1116,8 @@ AddStr(char *str, int strlength, int mderef)
1109
1116
int hashresult ;
1110
1117
int len ;
1111
1118
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" );
1120
1121
1121
1122
/*
1122
1123
* Some of the utilites (eg, define type, create relation) assume that
0 commit comments