Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a57d312
Support infinity and -infinity in the numeric data type.
tglsfdc Jul 22, 2020
38f60f1
Revert "Fix corner case with PGP decompression in pgcrypto"
michaelpq Jul 22, 2020
c55040c
WAL Log invalidations at command end with wal_level=logical.
Jul 23, 2020
42dee8b
Fix error message.
macdice Jul 23, 2020
5733fa0
doc: Document that ssl_ciphers does not affect TLS 1.3
petere Jul 23, 2020
b9b6105
Fix ancient violation of zlib's API spec.
tglsfdc Jul 23, 2020
25244b8
Rename configure.in to configure.ac
petere Jul 24, 2020
2f2007f
Fix assorted bugs by changing TS_execute's callback API to ternary lo…
tglsfdc Jul 24, 2020
79d6d1a
Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT.
tglsfdc Jul 24, 2020
2a24942
Fix buffer usage stats for nodes above Gather Merge.
Jul 25, 2020
8a37951
Mark built-in coercion functions as leakproof where possible.
tglsfdc Jul 25, 2020
0a0727c
Improve performance of binary COPY FROM through better buffering.
tglsfdc Jul 25, 2020
ce4939f
Use RAND_poll() for seeding randomness after fork().
nmisch Jul 25, 2020
15e4419
Remove optimization for RAND_poll() failing.
nmisch Jul 25, 2020
11a68e4
Tweak behavior of pg_stat_activity.leader_pid
michaelpq Jul 26, 2020
56788d2
Allocate consecutive blocks during parallel seqscans
david-rowley Jul 26, 2020
200f610
Fix LookupTupleHashEntryHash() pipeline-stall issue.
jeff-davis Jul 26, 2020
e971357
Fix handling of structure for bytea data type in ECPG
michaelpq Jul 27, 2020
a3ab7a7
Fix corner case with 16kB-long decompression in pgcrypto, take 2
michaelpq Jul 27, 2020
bcbf944
Remove hashagg_avoid_disk_plan GUC.
petergeoghegan Jul 28, 2020
1383874
Fix some issues with step generation in partition pruning.
Jul 28, 2020
45fdc97
Extend the logical decoding output plugin API with stream methods.
Jul 28, 2020
d7c8576
Doc: Improve documentation for pg_jit_available()
david-rowley Jul 28, 2020
0e3e1c4
Make EXPLAIN ANALYZE of HashAgg more similar to Hash Join
david-rowley Jul 28, 2020
f36e820
Doc: Remove obsolete CREATE AGGREGATE note.
petergeoghegan Jul 28, 2020
b1d7912
Correct obsolete UNION hash aggs comment.
petergeoghegan Jul 29, 2020
c49c74d
Rename another "hash_mem" local variable.
petergeoghegan Jul 29, 2020
cb04ad4
Move syncscan.c to src/backend/access/common.
macdice Jul 29, 2020
f2130e7
Fix incorrect print format in json.c
michaelpq Jul 29, 2020
9878b64
HashAgg: use better cardinality estimate for recursive spilling.
jeff-davis Jul 29, 2020
b5310e4
Remove non-fast promotion.
MasaoFujii Jul 29, 2020
6023b7e
pg_stat_statements: track number of rows processed by some utility co…
MasaoFujii Jul 29, 2020
d6c08e2
Add hash_mem_multiplier GUC.
petergeoghegan Jul 29, 2020
3347c98
Use a long lived WaitEventSet for WaitLatch().
macdice Jul 30, 2020
e2d394d
Use WaitLatch() for condition variables.
macdice Jul 30, 2020
e7591fd
Introduce a WaitEventSet for the stats collector.
macdice Jul 30, 2020
903134f
doc: Mention index references in pg_inherits
michaelpq Jul 30, 2020
f1af75c
Include partitioned tables for tab completion of VACUUM in psql
michaelpq Jul 30, 2020
fd734f3
Use pg_bitutils for HyperLogLog.
jeff-davis Jul 30, 2020
cab2556
Doc: fix high availability solutions comparison.
tatsuo-ishii Jul 30, 2020
e3931d0
Use multi-inserts for pg_attribute and pg_shdepend
michaelpq Jul 31, 2020
c5315f4
Cache smgrnblocks() results in recovery.
macdice Jul 31, 2020
7b1110d
Fix comment in instrument.h
michaelpq Jul 31, 2020
84b1c63
Preallocate some DSM space at startup.
macdice Jul 31, 2020
7be0449
Fix compiler warning from Clang.
macdice Jul 31, 2020
78e73e8
Fix recently-introduced performance problem in ts_headline().
tglsfdc Jul 31, 2020
3d2376d
Fix oversight in ALTER TYPE: typmodin/typmodout must propagate to arr…
tglsfdc Jul 31, 2020
c79aed4
Restore lost amcheck TOAST test coverage.
petergeoghegan Jul 31, 2020
84c0e4b
Improve programmer docs for simplehash and dynahash.
macdice Aug 1, 2020
022350b
Minimize slot creation for multi-inserts of pg_shdepend
michaelpq Aug 1, 2020
e2b37d9
Use pg_pread() and pg_pwrite() in slru.c.
macdice Aug 1, 2020
9f96827
Invent "amadjustmembers" AM method for validating opclass members.
tglsfdc Aug 1, 2020
cd5e822
Change XID and mxact limits to warn at 40M and stop at 3M.
nmisch Aug 1, 2020
6ee3b5f
Use int64 instead of long in incremental sort code
david-rowley Aug 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/general.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# argument (other than "yes/no"), etc.
#
# The point of this implementation is to reduce code size and
# redundancy in configure.in and to improve robustness and consistency
# redundancy in configure.ac and to improve robustness and consistency
# in the option evaluation code.


Expand Down
4 changes: 2 additions & 2 deletions configure.in → configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
dnl configure.in
dnl configure.ac
dnl
dnl Developers, please strive to achieve this order:
dnl
Expand All @@ -21,7 +21,7 @@ AC_INIT([PostgreSQL], [14devel], [pgsql-bugs@lists.postgresql.org], [], [https:/

m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
recommended. You can remove the check from 'configure.in' but it is then
recommended. You can remove the check from 'configure.ac' but it is then
your responsibility whether the result works or not.])])
AC_COPYRIGHT([Copyright (c) 1996-2020, PostgreSQL Global Development Group])
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
Expand Down
16 changes: 12 additions & 4 deletions contrib/amcheck/expected/check_btree.out
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,19 @@ SELECT bt_index_parent_check('delete_test_table_pkey', true);
-- tuple. Bloom filter must fingerprint normalized index tuple representation.
--
CREATE TABLE toast_bug(buggy text);
ALTER TABLE toast_bug ALTER COLUMN buggy SET STORAGE plain;
-- pg_attribute entry for toasty.buggy will have plain storage:
CREATE INDEX toasty ON toast_bug(buggy);
-- Whereas pg_attribute entry for toast_bug.buggy now has extended storage:
ALTER TABLE toast_bug ALTER COLUMN buggy SET STORAGE extended;
CREATE INDEX toasty ON toast_bug(buggy);
-- pg_attribute entry for toasty.buggy (the index) will have plain storage:
UPDATE pg_attribute SET attstorage = 'p'
WHERE attrelid = 'toasty'::regclass AND attname = 'buggy';
-- Whereas pg_attribute entry for toast_bug.buggy (the table) still has extended storage:
SELECT attstorage FROM pg_attribute
WHERE attrelid = 'toast_bug'::regclass AND attname = 'buggy';
attstorage
------------
x
(1 row)

-- Insert compressible heap tuple (comfortably exceeds TOAST_TUPLE_THRESHOLD):
INSERT INTO toast_bug SELECT repeat('a', 2200);
-- Should not get false positive report of corruption:
Expand Down
14 changes: 10 additions & 4 deletions contrib/amcheck/sql/check_btree.sql
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,17 @@ SELECT bt_index_parent_check('delete_test_table_pkey', true);
-- tuple. Bloom filter must fingerprint normalized index tuple representation.
--
CREATE TABLE toast_bug(buggy text);
ALTER TABLE toast_bug ALTER COLUMN buggy SET STORAGE plain;
-- pg_attribute entry for toasty.buggy will have plain storage:
CREATE INDEX toasty ON toast_bug(buggy);
-- Whereas pg_attribute entry for toast_bug.buggy now has extended storage:
ALTER TABLE toast_bug ALTER COLUMN buggy SET STORAGE extended;
CREATE INDEX toasty ON toast_bug(buggy);

-- pg_attribute entry for toasty.buggy (the index) will have plain storage:
UPDATE pg_attribute SET attstorage = 'p'
WHERE attrelid = 'toasty'::regclass AND attname = 'buggy';

-- Whereas pg_attribute entry for toast_bug.buggy (the table) still has extended storage:
SELECT attstorage FROM pg_attribute
WHERE attrelid = 'toast_bug'::regclass AND attname = 'buggy';

-- Insert compressible heap tuple (comfortably exceeds TOAST_TUPLE_THRESHOLD):
INSERT INTO toast_bug SELECT repeat('a', 2200);
-- Should not get false positive report of corruption:
Expand Down
1 change: 1 addition & 0 deletions contrib/bloom/blutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ blhandler(PG_FUNCTION_ARGS)
amroutine->amproperty = NULL;
amroutine->ambuildphasename = NULL;
amroutine->amvalidate = blvalidate;
amroutine->amadjustmembers = NULL;
amroutine->ambeginscan = blbeginscan;
amroutine->amrescan = blrescan;
amroutine->amgettuple = NULL;
Expand Down
6 changes: 2 additions & 4 deletions contrib/jsonb_plperl/jsonb_plperl.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,8 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem)
/*
* jsonb doesn't allow infinity or NaN (per JSON
* specification), but the numeric type that is used for the
* storage accepts NaN, so we have to prevent it here
* explicitly. We don't really have to check for isinf()
* here, as numeric doesn't allow it and it would be caught
* later, but it makes for a nicer error message.
* storage accepts those, so we have to reject them here
* explicitly.
*/
if (isinf(nval))
ereport(ERROR,
Expand Down
9 changes: 6 additions & 3 deletions contrib/jsonb_plpython/jsonb_plpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,17 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum)
pfree(str);

/*
* jsonb doesn't allow NaN (per JSON specification), so we have to prevent
* it here explicitly. (Infinity is also not allowed in jsonb, but
* numeric_in above already catches that.)
* jsonb doesn't allow NaN or infinity (per JSON specification), so we
* have to reject those here explicitly.
*/
if (numeric_is_nan(num))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("cannot convert NaN to jsonb")));
if (numeric_is_inf(num))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("cannot convert infinity to jsonb")));

jbvNum->type = jbvNumeric;
jbvNum->val.numeric = num;
Expand Down
66 changes: 66 additions & 0 deletions contrib/pg_stat_statements/expected/pg_stat_statements.out
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,69 @@ SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C";
SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C" | 0 | 0
(9 rows)

--
-- Track the total number of rows retrieved or affected by the utility
-- commands of COPY, FETCH, CREATE TABLE AS, CREATE MATERIALIZED VIEW
-- and SELECT INTO
--
SELECT pg_stat_statements_reset();
pg_stat_statements_reset
--------------------------

(1 row)

CREATE TABLE pgss_ctas AS SELECT a, 'ctas' b FROM generate_series(1, 10) a;
SELECT generate_series(1, 10) c INTO pgss_select_into;
COPY pgss_ctas (a, b) FROM STDIN;
CREATE MATERIALIZED VIEW pgss_matv AS SELECT * FROM pgss_ctas;
BEGIN;
DECLARE pgss_cursor CURSOR FOR SELECT * FROM pgss_matv;
FETCH NEXT pgss_cursor;
a | b
---+------
1 | ctas
(1 row)

FETCH FORWARD 5 pgss_cursor;
a | b
---+------
2 | ctas
3 | ctas
4 | ctas
5 | ctas
6 | ctas
(5 rows)

FETCH FORWARD ALL pgss_cursor;
a | b
----+------
7 | ctas
8 | ctas
9 | ctas
10 | ctas
11 | copy
12 | copy
13 | copy
(7 rows)

COMMIT;
SELECT query, plans, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C";
query | plans | calls | rows
-------------------------------------------------------------------------------------+-------+-------+------
BEGIN | 0 | 1 | 0
COMMIT | 0 | 1 | 0
COPY pgss_ctas (a, b) FROM STDIN | 0 | 1 | 3
CREATE MATERIALIZED VIEW pgss_matv AS SELECT * FROM pgss_ctas | 0 | 1 | 13
CREATE TABLE pgss_ctas AS SELECT a, 'ctas' b FROM generate_series(1, 10) a | 0 | 1 | 10
DECLARE pgss_cursor CURSOR FOR SELECT * FROM pgss_matv | 0 | 1 | 0
FETCH FORWARD 5 pgss_cursor | 0 | 1 | 5
FETCH FORWARD ALL pgss_cursor | 0 | 1 | 7
FETCH NEXT pgss_cursor | 0 | 1 | 1
SELECT generate_series(1, 10) c INTO pgss_select_into | 0 | 1 | 10
SELECT pg_stat_statements_reset() | 0 | 1 | 1
SELECT query, plans, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C" | 1 | 0 | 0
(12 rows)

--
-- Track user activity and reset them
--
Expand Down Expand Up @@ -728,6 +791,9 @@ SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C";
--
DROP ROLE regress_stats_user1;
DROP ROLE regress_stats_user2;
DROP MATERIALIZED VIEW pgss_matv;
DROP TABLE pgss_ctas;
DROP TABLE pgss_select_into;
--
-- [re]plan counting
--
Expand Down
10 changes: 9 additions & 1 deletion contrib/pg_stat_statements/pg_stat_statements.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,15 @@ pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
INSTR_TIME_SET_CURRENT(duration);
INSTR_TIME_SUBTRACT(duration, start);

rows = (qc && qc->commandTag == CMDTAG_COPY) ? qc->nprocessed : 0;
/*
* Track the total number of rows retrieved or affected by
* the utility statements of COPY, FETCH, CREATE TABLE AS,
* CREATE MATERIALIZED VIEW and SELECT INTO.
*/
rows = (qc && (qc->commandTag == CMDTAG_COPY ||
qc->commandTag == CMDTAG_FETCH ||
qc->commandTag == CMDTAG_SELECT)) ?
qc->nprocessed : 0;

/* calc differences of buffer counters. */
memset(&bufusage, 0, sizeof(BufferUsage));
Expand Down
27 changes: 27 additions & 0 deletions contrib/pg_stat_statements/sql/pg_stat_statements.sql
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,30 @@ DROP FUNCTION PLUS_TWO(INTEGER);

SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C";

--
-- Track the total number of rows retrieved or affected by the utility
-- commands of COPY, FETCH, CREATE TABLE AS, CREATE MATERIALIZED VIEW
-- and SELECT INTO
--
SELECT pg_stat_statements_reset();

CREATE TABLE pgss_ctas AS SELECT a, 'ctas' b FROM generate_series(1, 10) a;
SELECT generate_series(1, 10) c INTO pgss_select_into;
COPY pgss_ctas (a, b) FROM STDIN;
11 copy
12 copy
13 copy
\.
CREATE MATERIALIZED VIEW pgss_matv AS SELECT * FROM pgss_ctas;
BEGIN;
DECLARE pgss_cursor CURSOR FOR SELECT * FROM pgss_matv;
FETCH NEXT pgss_cursor;
FETCH FORWARD 5 pgss_cursor;
FETCH FORWARD ALL pgss_cursor;
COMMIT;

SELECT query, plans, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C";

--
-- Track user activity and reset them
--
Expand Down Expand Up @@ -313,6 +337,9 @@ SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C";
--
DROP ROLE regress_stats_user1;
DROP ROLE regress_stats_user2;
DROP MATERIALIZED VIEW pgss_matv;
DROP TABLE pgss_ctas;
DROP TABLE pgss_select_into;

--
-- [re]plan counting
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_visibility/pg_visibility.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
check_relation_relkind(rel);

RelationOpenSmgr(rel);
rel->rd_smgr->smgr_vm_nblocks = InvalidBlockNumber;
rel->rd_smgr->smgr_cached_nblocks[VISIBILITYMAP_FORKNUM] = InvalidBlockNumber;

block = visibilitymap_prepare_truncate(rel, 0);
if (BlockNumberIsValid(block))
Expand Down
53 changes: 37 additions & 16 deletions contrib/pgcrypto/pgp-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ compress_process(PushFilter *next, void *priv, const uint8 *data, int len)
/*
* process data
*/
while (len > 0)
st->stream.next_in = unconstify(uint8 *, data);
st->stream.avail_in = len;
while (st->stream.avail_in > 0)
{
st->stream.next_in = unconstify(uint8 *, data);
st->stream.avail_in = len;
st->stream.next_out = st->buf;
st->stream.avail_out = st->buf_len;
res = deflate(&st->stream, 0);
res = deflate(&st->stream, Z_NO_FLUSH);
if (res != Z_OK)
return PXE_PGP_COMPRESSION_ERROR;

Expand All @@ -131,7 +131,6 @@ compress_process(PushFilter *next, void *priv, const uint8 *data, int len)
if (res < 0)
return res;
}
len = st->stream.avail_in;
}

return 0;
Expand All @@ -154,6 +153,7 @@ compress_flush(PushFilter *next, void *priv)
zres = deflate(&st->stream, Z_FINISH);
if (zres != Z_STREAM_END && zres != Z_OK)
return PXE_PGP_COMPRESSION_ERROR;

n_out = st->buf_len - st->stream.avail_out;
if (n_out > 0)
{
Expand Down Expand Up @@ -243,17 +243,6 @@ decompress_read(void *priv, PullFilter *src, int len,
struct DecomprData *dec = priv;

restart:
if (dec->stream.avail_in == 0)
{
uint8 *tmp;

res = pullf_read(src, 8192, &tmp);
if (res < 0)
return res;
dec->stream.next_in = tmp;
dec->stream.avail_in = res;
}

if (dec->buf_data > 0)
{
if (len > dec->buf_data)
Expand All @@ -267,6 +256,17 @@ decompress_read(void *priv, PullFilter *src, int len,
if (dec->eof)
return 0;

if (dec->stream.avail_in == 0)
{
uint8 *tmp;

res = pullf_read(src, 8192, &tmp);
if (res < 0)
return res;
dec->stream.next_in = tmp;
dec->stream.avail_in = res;
}

dec->stream.next_out = dec->buf;
dec->stream.avail_out = dec->buf_len;
dec->pos = dec->buf;
Expand All @@ -286,7 +286,28 @@ decompress_read(void *priv, PullFilter *src, int len,

dec->buf_data = dec->buf_len - dec->stream.avail_out;
if (res == Z_STREAM_END)
{
uint8 *tmp;

/*
* A stream must be terminated by a normal packet. If the last stream
* packet in the source stream is a full packet, a normal empty packet
* must follow. Since the underlying packet reader doesn't know that
* the compressed stream has been ended, we need to to consume the
* terminating packet here. This read does not harm even if the
* stream has already ended.
*/
res = pullf_read(src, 1, &tmp);

if (res < 0)
return res;
else if (res > 0)
{
px_debug("decompress_read: extra bytes after end of stream");
return PXE_PGP_CORRUPT_DATA;
}
dec->eof = 1;
}
goto restart;
}

Expand Down
Loading