From 272b6ef20d7644f8785a3202c9c4b7793363aede Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 20 Feb 2007 23:49:38 +0000 Subject: [PATCH] Prevent BLCKSZ < 1024, and have initdb test shared buffers based on the BLCKSZ value. --- src/bin/initdb/initdb.c | 5 +++-- src/include/pg_config_manual.h | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 3001e325b2..b0a875234a 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -42,7 +42,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * Portions taken from FreeBSD. * - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.133 2007/02/16 02:10:07 alvherre Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.134 2007/02/20 23:49:38 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1208,7 +1208,8 @@ test_config_settings(void) for (i = 0; i < bufslen; i++) { - test_buffs = trial_bufs[i]; + /* Use same amount of memory, independent of BLCKSZ */ + test_buffs = (trial_bufs[i] * 8192) / BLCKSZ; if (test_buffs <= ok_buffers) { test_buffs = ok_buffers; diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index 074833d198..fba9ffac23 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -6,7 +6,7 @@ * for developers. If you edit any of these, be sure to do a *full* * rebuild (and an initdb if noted). * - * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.24 2007/02/06 09:16:08 petere Exp $ + * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.25 2007/02/20 23:49:38 momjian Exp $ *------------------------------------------------------------------------ */ @@ -25,6 +25,10 @@ */ #define BLCKSZ 8192 +#if BLCKSZ < 1024 +#error BLCKSZ must be >= 1024 +#endif + /* * RELSEG_SIZE is the maximum number of blocks allowed in one disk * file. Thus, the maximum size of a single file is RELSEG_SIZE * -- 2.40.0