Compare commits

..

No commits in common. "ff68cc6f3bf08546802216e0b9d28ad1d4be7e70" and "e83aa9f92fdd88c2912cc43a61fd9f59f4c8f4d3" have entirely different histories.

7 changed files with 17 additions and 32 deletions

View File

@ -2303,8 +2303,8 @@ include_dir 'conf.d'
</term> </term>
<listitem> <listitem>
<para> <para>
This is the accumulated cost that will cause the vacuuming process to sleep The accumulated cost that will cause the vacuuming process to sleep.
for <varname>vacuum_cost_delay</varname>. The default is 200. The default value is 200.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -2364,7 +2364,7 @@ include_dir 'conf.d'
<varname>bgwriter_delay</varname>. <varname>bgwriter_delay</varname>.
If this value is specified without units, it is taken as milliseconds. If this value is specified without units, it is taken as milliseconds.
The default value is 200 The default value is 200
milliseconds (<literal>200ms</literal>). Note that on some systems, the milliseconds (<literal>200ms</literal>). Note that on many systems, the
effective resolution of sleep delays is 10 milliseconds; setting effective resolution of sleep delays is 10 milliseconds; setting
<varname>bgwriter_delay</varname> to a value that is not a multiple of 10 <varname>bgwriter_delay</varname> to a value that is not a multiple of 10
might have the same results as setting it to the next higher multiple might have the same results as setting it to the next higher multiple
@ -3258,7 +3258,7 @@ include_dir 'conf.d'
flushed to disk. flushed to disk.
If this value is specified without units, it is taken as milliseconds. If this value is specified without units, it is taken as milliseconds.
The default value is 200 milliseconds (<literal>200ms</literal>). Note that The default value is 200 milliseconds (<literal>200ms</literal>). Note that
on some systems, the effective resolution of sleep delays is 10 on many systems, the effective resolution of sleep delays is 10
milliseconds; setting <varname>wal_writer_delay</varname> to a value that is milliseconds; setting <varname>wal_writer_delay</varname> to a value that is
not a multiple of 10 might have the same results as setting it to the not a multiple of 10 might have the same results as setting it to the
next higher multiple of 10. This parameter can only be set in the next higher multiple of 10. This parameter can only be set in the

View File

@ -86,7 +86,7 @@
<listitem> <listitem>
<para> <para>
On <productname>FreeBSD</productname>, IDE drives can be queried using On <productname>FreeBSD</productname>, IDE drives can be queried using
<command>camcontrol identify</command> and write caching turned off using <command>atacontrol</command> and write caching turned off using
<literal>hw.ata.wc=0</literal> in <filename>/boot/loader.conf</filename>; <literal>hw.ata.wc=0</literal> in <filename>/boot/loader.conf</filename>;
SCSI drives can be queried using <command>camcontrol identify</command>, SCSI drives can be queried using <command>camcontrol identify</command>,
and the write cache both queried and changed using and the write cache both queried and changed using

View File

@ -1144,7 +1144,6 @@ replorigin_session_setup(RepOriginId node, int acquired_by)
/* ok, found slot */ /* ok, found slot */
session_replication_state = curstate; session_replication_state = curstate;
break;
} }

View File

@ -1401,7 +1401,7 @@ print_aligned_vertical(const printTableContent *cont,
} }
/* find longest data cell */ /* find longest data cell */
for (ptr = cont->cells; *ptr; ptr++) for (i = 0, ptr = cont->cells; *ptr; ptr++, i++)
{ {
int width, int width,
height, height,
@ -3172,8 +3172,6 @@ void
printTableInit(printTableContent *const content, const printTableOpt *opt, printTableInit(printTableContent *const content, const printTableOpt *opt,
const char *title, const int ncolumns, const int nrows) const char *title, const int ncolumns, const int nrows)
{ {
uint64 total_cells;
content->opt = opt; content->opt = opt;
content->title = title; content->title = title;
content->ncolumns = ncolumns; content->ncolumns = ncolumns;
@ -3181,16 +3179,7 @@ printTableInit(printTableContent *const content, const printTableOpt *opt,
content->headers = pg_malloc0((ncolumns + 1) * sizeof(*content->headers)); content->headers = pg_malloc0((ncolumns + 1) * sizeof(*content->headers));
total_cells = (uint64) ncolumns * nrows; content->cells = pg_malloc0((ncolumns * nrows + 1) * sizeof(*content->cells));
/* Catch possible overflow. Using >= here allows adding 1 below */
if (total_cells >= SIZE_MAX / sizeof(*content->cells))
{
fprintf(stderr, _("Cannot print table contents: number of cells %lld is equal to or exceeds maximum %lld.\n"),
(long long int) total_cells,
(long long int) (SIZE_MAX / sizeof(*content->cells)));
exit(EXIT_FAILURE);
}
content->cells = pg_malloc0((total_cells + 1) * sizeof(*content->cells));
content->cellmustfree = NULL; content->cellmustfree = NULL;
content->footers = NULL; content->footers = NULL;
@ -3260,17 +3249,15 @@ void
printTableAddCell(printTableContent *const content, char *cell, printTableAddCell(printTableContent *const content, char *cell,
const bool translate, const bool mustfree) const bool translate, const bool mustfree)
{ {
uint64 total_cells;
#ifndef ENABLE_NLS #ifndef ENABLE_NLS
(void) translate; /* unused parameter */ (void) translate; /* unused parameter */
#endif #endif
total_cells = (uint64) content->ncolumns * content->nrows; if (content->cellsadded >= content->ncolumns * content->nrows)
if (content->cellsadded >= total_cells)
{ {
fprintf(stderr, _("Cannot add cell to table content: total cell count of %lld exceeded.\n"), fprintf(stderr, _("Cannot add cell to table content: "
(long long int) total_cells); "total cell count of %d exceeded.\n"),
content->ncolumns * content->nrows);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -3286,7 +3273,7 @@ printTableAddCell(printTableContent *const content, char *cell,
{ {
if (content->cellmustfree == NULL) if (content->cellmustfree == NULL)
content->cellmustfree = content->cellmustfree =
pg_malloc0((total_cells + 1) * sizeof(bool)); pg_malloc0((content->ncolumns * content->nrows + 1) * sizeof(bool));
content->cellmustfree[content->cellsadded] = true; content->cellmustfree[content->cellsadded] = true;
} }
@ -3354,10 +3341,9 @@ printTableCleanup(printTableContent *const content)
{ {
if (content->cellmustfree) if (content->cellmustfree)
{ {
uint64 total_cells; int i;
total_cells = (uint64) content->ncolumns * content->nrows; for (i = 0; i < content->nrows * content->ncolumns; i++)
for (uint64 i = 0; i < total_cells; i++)
{ {
if (content->cellmustfree[i]) if (content->cellmustfree[i])
free(unconstify(char *, content->cells[i])); free(unconstify(char *, content->cells[i]));

View File

@ -171,7 +171,7 @@ typedef struct printTableContent
const char **cells; /* NULL-terminated array of cell content const char **cells; /* NULL-terminated array of cell content
* strings */ * strings */
const char **cell; /* Pointer to the last added cell */ const char **cell; /* Pointer to the last added cell */
uint64 cellsadded; /* Number of cells added this far */ long cellsadded; /* Number of cells added this far */
bool *cellmustfree; /* true for cells that need to be free()d */ bool *cellmustfree; /* true for cells that need to be free()d */
printTableFooter *footers; /* Pointer to the first footer */ printTableFooter *footers; /* Pointer to the first footer */
printTableFooter *footer; /* Pointer to the last added footer */ printTableFooter *footer; /* Pointer to the last added footer */

View File

@ -1920,7 +1920,7 @@ WHERE p1.oid = a1.amhandler AND a1.amtype = 'i' AND
-- Check for table amhandler functions with the wrong signature -- Check for table amhandler functions with the wrong signature
SELECT a1.oid, a1.amname, p1.oid, p1.proname SELECT a1.oid, a1.amname, p1.oid, p1.proname
FROM pg_am AS a1, pg_proc AS p1 FROM pg_am AS a1, pg_proc AS p1
WHERE p1.oid = a1.amhandler AND a1.amtype = 't' AND WHERE p1.oid = a1.amhandler AND a1.amtype = 's' AND
(p1.prorettype != 'table_am_handler'::regtype (p1.prorettype != 'table_am_handler'::regtype
OR p1.proretset OR p1.proretset
OR p1.pronargs != 1 OR p1.pronargs != 1

View File

@ -1223,7 +1223,7 @@ WHERE p1.oid = a1.amhandler AND a1.amtype = 'i' AND
SELECT a1.oid, a1.amname, p1.oid, p1.proname SELECT a1.oid, a1.amname, p1.oid, p1.proname
FROM pg_am AS a1, pg_proc AS p1 FROM pg_am AS a1, pg_proc AS p1
WHERE p1.oid = a1.amhandler AND a1.amtype = 't' AND WHERE p1.oid = a1.amhandler AND a1.amtype = 's' AND
(p1.prorettype != 'table_am_handler'::regtype (p1.prorettype != 'table_am_handler'::regtype
OR p1.proretset OR p1.proretset
OR p1.pronargs != 1 OR p1.pronargs != 1