|
27 | 27 | # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group |
28 | 28 | # Portions Copyright (c) 1994, Regents of the University of California |
29 | 29 | # |
30 | | -# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.203 2003/09/27 16:27:57 momjian Exp $ |
| 30 | +# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.204 2003/10/13 21:06:44 tgl Exp $ |
31 | 31 | # |
32 | 32 | #------------------------------------------------------------------------- |
33 | 33 |
|
@@ -550,29 +550,32 @@ echo "$short_version" > "$PGDATA/PG_VERSION" || exit_nicely |
550 | 550 | # |
551 | 551 | # DETERMINE PLATFORM-SPECIFIC CONFIG SETTINGS |
552 | 552 | # |
553 | | -# Use reasonable values if kernel will let us, else scale back |
| 553 | +# Use reasonable values if kernel will let us, else scale back. Probe for |
| 554 | +# max_connections first since it is subject to more constraints than |
| 555 | +# shared_buffers. |
554 | 556 |
|
555 | 557 | # common backend options |
556 | 558 | PGSQL_OPT="-F -D$PGDATA" |
557 | 559 |
|
558 | 560 | cp /dev/null"$PGDATA"/postgresql.conf|| exit_nicely |
559 | 561 |
|
560 | | -$ECHO_N"selecting defaultshared_buffers..."$ECHO_C |
| 562 | +$ECHO_N"selecting defaultmax_connections..."$ECHO_C |
561 | 563 |
|
562 | | -fornbuffersin1000 900 800 700 600 500 400 300 200 100 50 |
| 564 | +fornconnsin100 50 40 30 20 10 |
563 | 565 | do |
564 | | - TEST_OPT="$PGSQL_OPT -c shared_buffers=$nbuffers -c max_connections=5" |
| 566 | + nbuffers=`expr$nconns'*' 5` |
| 567 | + TEST_OPT="$PGSQL_OPT -c shared_buffers=$nbuffers -c max_connections=$nconns" |
565 | 568 | if"$PGPATH"/postgres -boot -x0$TEST_OPT template1</dev/null>/dev/null2>&1 |
566 | 569 | then |
567 | 570 | break |
568 | 571 | fi |
569 | 572 | done |
570 | 573 |
|
571 | | -echo"$nbuffers" |
| 574 | +echo"$nconns" |
572 | 575 |
|
573 | | -$ECHO_N"selecting defaultmax_connections..."$ECHO_C |
| 576 | +$ECHO_N"selecting defaultshared_buffers..."$ECHO_C |
574 | 577 |
|
575 | | -fornconnsin100 50 40 30 20 10 |
| 578 | +fornbuffersin1000 900 800 700 600 500 400 300 200 100 50 |
576 | 579 | do |
577 | 580 | TEST_OPT="$PGSQL_OPT -c shared_buffers=$nbuffers -c max_connections=$nconns" |
578 | 581 | if"$PGPATH"/postgres -boot -x0$TEST_OPT template1</dev/null>/dev/null2>&1 |
|
581 | 584 | fi |
582 | 585 | done |
583 | 586 |
|
584 | | -echo"$nconns" |
| 587 | +echo"$nbuffers" |
585 | 588 |
|
586 | 589 | ########################################################################## |
587 | 590 | # |
@@ -1088,12 +1091,9 @@ $ECHO_N "creating information schema... "$ECHO_C |
1088 | 1091 |
|
1089 | 1092 | echo"UPDATE information_schema.sql_implementation_info SET character_value = '$combined_version' WHERE implementation_info_name = 'DBMS VERSION';" |
1090 | 1093 |
|
1091 | | -echo"COPY information_schema.sql_features (feature_id, feature_name, sub_feature_id, sub_feature_name, is_supported, comments) FROM STDIN;" |
1092 | | - cat"$datadir"/sql_features.txt |
1093 | | -echo"\." |
1094 | | -)| |
1095 | | -tr -d'\r'|# make newlines consistent for Win32 |
1096 | | -"$PGPATH"/postgres$PGSQL_OPT template1> /dev/null|| exit_nicely |
| 1094 | +echo"COPY information_schema.sql_features (feature_id, feature_name, sub_feature_id, sub_feature_name, is_supported, comments) FROM '$datadir/sql_features.txt';" |
| 1095 | +) \ |
| 1096 | +|"$PGPATH"/postgres$PGSQL_OPT template1> /dev/null|| exit_nicely |
1097 | 1097 | echo"ok" |
1098 | 1098 |
|
1099 | 1099 | $ECHO_N"vacuuming database template1..."$ECHO_C |
|