Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
b3d6e8b
Don't treat EINVAL from semget() as a hard failure.
tglsfdc Aug 13, 2025
2c7c08a
Fix invalid format string in HASH_DEBUG code
david-rowley Aug 15, 2025
59bab34
Update obsolete comments in ResultRelInfo struct.
Aug 17, 2025
ef77502
Fix self-deadlock during DROP SUBSCRIPTION.
Aug 19, 2025
7964310
Add CHECK_FOR_INTERRUPTS in contrib/pg_buffercache functions.
MasahikoSawada Aug 19, 2025
32d388d
Fix assertion failure with replication slot release in single-user mode
michaelpq Aug 20, 2025
24145bb
doc: Improve description of wal_compression
michaelpq Aug 21, 2025
222130e
Ignore temporary relations in RelidByRelfilenumber()
michaelpq Aug 22, 2025
4948bb9
Sort DO_DEFAULT_ACL dump objects independent of OIDs.
nmisch Aug 23, 2025
22c6a44
Rewrite previous commit's test for TestUpgradeXversion compatibility.
nmisch Aug 23, 2025
a7da746
Do CHECK_FOR_INTERRUPTS inside, not before, scanGetItem.
tglsfdc Aug 26, 2025
4a59304
Put "excludeOnly" GIN scan keys at the end of the scankey array.
tglsfdc Aug 26, 2025
b830f9d
CREATE STATISTICS: improve misleading error message
alvherre Aug 29, 2025
0cc540f
libpq: Fix PQtrace() format for non-printable characters
michaelpq Sep 3, 2025
160ef51
Fix planner error when estimating SubPlan cost
Sep 3, 2025
5fd569e
Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
deanrasheed Sep 4, 2025
ea65c88
Fix compiler error introduced by 5386bfb9c1f.
deanrasheed Sep 4, 2025
5eab9b0
Fix memory leakage in nodeSubplan.c.
tglsfdc Sep 10, 2025
5e13148
Fix description of WAL record blocks in hash_xlog.h
michaelpq Sep 11, 2025
f75ff1b
Amend recent fix for SIMILAR TO regex conversion.
tglsfdc Sep 13, 2025
fbfc36e
jit: fix build with LLVM-21
petere Sep 15, 2025
cbd3732
CREATE STATISTICS: improve misleading error message
petere Sep 15, 2025
db900ec
pg_restore: Fix comment handling with --no-publications / --no-subscr…
MasaoFujii Sep 16, 2025
295c0a6
pg_dump: Fix dumping of security labels on subscriptions and event tr…
MasaoFujii Sep 16, 2025
85d6ed3
Fix pg_dump COMMENT dependency for separate domain constraints.
nmisch Sep 16, 2025
2eb7ea9
Add missing EPQ recheck for TID Scan
david-rowley Sep 16, 2025
f78a690
Add missing EPQ recheck for TID Range Scan
david-rowley Sep 17, 2025
31bf096
Calculate agglevelsup correctly when Aggref contains a CTE.
tglsfdc Sep 17, 2025
bc476f8
pg_restore: Fix security label handling with --no-publications/subscr…
MasaoFujii Sep 18, 2025
0be39b4
Fix missed copying of groupDistinct in transformPLAssignStmt.
tglsfdc Sep 27, 2025
5816baa
Fix StatisticsObjIsVisibleExt() for pg_temp.
nmisch Sep 29, 2025
cb21e1f
pgbench: Fix error reporting in readCommandResponse().
MasaoFujii Sep 30, 2025
ee2dbca
pgstattuple: Improve reports generated for indexes (hash, gist, btree)
michaelpq Oct 2, 2025
9b3beb7
pgbench: Fail cleanly when finding a COPY result state
michaelpq Oct 3, 2025
f46d773
Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c.
tglsfdc Oct 5, 2025
f57f276
Remove state.tmp when failing to save a replication slot
michaelpq Oct 10, 2025
3140040
Remove overzealous _bt_killitems assertion.
petergeoghegan Oct 10, 2025
b753be3
Stop creating constraints during DETACH CONCURRENTLY
alvherre Oct 11, 2025
715eb62
Doc: clarify n_distinct_inherited setting
david-rowley Oct 13, 2025
e91eb4a
Fix incorrect message-printing in win32security.c.
tglsfdc Oct 13, 2025
24e74b9
Fix EvalPlanQual handling of foreign/custom joins in ExecScanFetch.
Oct 15, 2025
56cd332
Fix update-po for the PGXS case
alvherre Oct 16, 2025
f146eb4
Fix privilege checks for pg_prewarm() on indexes.
nathan-bossart Oct 17, 2025
6062c3d
Fix pg_dump sorting of foreign key constraints
alvherre Oct 18, 2025
40dc710
Don't rely on zlib's gzgetc() macro.
tglsfdc Oct 19, 2025
5274f11
Fix POSIX compliance in pgwin32_unsetenv() for "name" argument
michaelpq Oct 20, 2025
eea24eb
Fix BRIN 32-bit counter wrap issue with huge tables
david-rowley Oct 21, 2025
e95010a
Re-pgindent brin.c.
nathan-bossart Oct 21, 2025
0a358eb
Add previous commit to .git-blame-ignore-revs.
nathan-bossart Oct 21, 2025
58ba7e5
Add .abi-compliance-history to back-branches.
nathan-bossart Oct 21, 2025
a7ab6ce
Fix stalled lag columns in pg_stat_replication when replay LSN stops …
MasaoFujii Oct 22, 2025
f106f53
Make invalid primary_slot_name follow standard GUC error reporting.
MasaoFujii Oct 22, 2025
e4316ec
Fix incorrect zero extension of Datum in JIT tuple deform code
david-rowley Oct 23, 2025
c4a6444
Add copyright notice to vacuum_horizon_floor.pl test.
MasahikoSawada Oct 23, 2025
10799d0
Add comments explaining overflow entries in the replication lag tracker.
MasaoFujii Oct 23, 2025
7fb8c92
Fix resource leaks in PL/Python error reporting, redux.
tglsfdc Oct 23, 2025
7b542cd
Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.
tglsfdc Oct 23, 2025
d454241
doc: Remove mention of Git protocol support
danielgustafsson Oct 23, 2025
86bd949
Fix bogus use of "long" in AllocSetCheck()
david-rowley Oct 30, 2025
4c0b7bd
doc: rewrite random_page_cost description
bmomjian Oct 30, 2025
d26997c
Avoid mixing void and integer in a conditional expression.
tglsfdc Nov 2, 2025
faba259
Doc: cover index CONCURRENTLY causing errors in INSERT ... ON CONFLICT.
nmisch Nov 3, 2025
a1b8b3b
Fix unconditional WAL receiver shutdown during stream-archive transition
michaelpq Nov 4, 2025
f0ad417
BRIN autosummarization may need a snapshot
alvherre Nov 4, 2025
04345d7
Tighten check for generated column in partition key expression
petere Nov 4, 2025
2c56b70
Have psql's "\? variables" show csv_fieldsep
alvherre Nov 4, 2025
371d40c
Backpatch: Fix warnings about declaration of environ on MinGW
anarazel Nov 4, 2025
65b0d1f
Fix snapshot handling bug in recent BRIN fix
alvherre Nov 4, 2025
0418716
jit: Fix accidentally-harmless type confusion
anarazel Nov 4, 2025
beba3c2
Fix timing-dependent failure in recovery test 004_timeline_switch
michaelpq Nov 5, 2025
66ea95f
postgres_fdw: Add more test coverage for EvalPlanQual testing.
Nov 6, 2025
b8b37f0
Update obsolete comment in ExecScanReScan().
Nov 6, 2025
ccfe28e
Disallow generated columns in COPY WHERE clause
petere Nov 6, 2025
d2965f6
Introduce XLogRecPtrIsValid()
alvherre Nov 6, 2025
9326cf9
doc: Fix descriptions of some PGC_POSTMASTER parameters.
MasaoFujii Nov 7, 2025
d8ba910
Fix generic read and write barriers for Clang.
macdice Nov 7, 2025
06827c5
Release notes for 18.1, 17.7, 16.11, 15.15, 14.20, 13.23.
tglsfdc Nov 9, 2025
e792be6
Translation updates
petere Nov 10, 2025
96d2c7e
libpq: Prevent some overflows of int/size_t
jchampio Nov 10, 2025
95cce56
Check for CREATE privilege on the schema in CREATE STATISTICS.
nathan-bossart Nov 10, 2025
ee953cd
Last-minute updates for release notes.
tglsfdc Nov 10, 2025
9ad034b
Stamp 14.20.
tglsfdc Nov 10, 2025
05f5c08
Update Postgres 14 to 14.20
tristan957 Nov 25, 2025
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
30 changes: 30 additions & 0 deletions .abi-compliance-history
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Reference point for ABI compliance checks
#
# This file lists commits on the current branch that break ABI compatibility in
# ways that have been deemed acceptable (e.g., removing an extern function with
# no third-party uses). The primary intent of this file is to control the ABI
# compliance checks on the buildfarm, but it also serves as a central location
# to document the justification for each.
#
# In general, entries should be added reactively after an abi-compliance-check
# buildfarm failure. It is important to verify the details of the breakage
# match expectations, as the first entry listed will become the updated ABI
# baseline point.
#
# Add new entries by adding the output of the following to the top of the file:
#
# $ git log --pretty=format:"%H%n#%n# %s%n# %cd%n#%n# <ADD JUSTIFICATION HERE>" $ABIBREAKGITHASH -1 --date=iso
#
# Be sure to replace "<ADD JUSTIFICATION HERE>" with details of your change and
# why it is deemed acceptable.

983b3636259b1502121cbae99d8a2f0d0515d87d
#
# Fix re-distributing previously distributed invalidation messages during logical decoding.
# 2025-06-16 17:35:50 -0700
#
# This is the original ABI baseline point for REL_14_STABLE. The first entry
# would ordinarily point to something just before the .0 release, but this file
# was first added in October 2025, and we're unlikely to act upon ABI breaks in
# released minor versions, so we've chosen to truncate the ABI history to start
# with the most recent ABI break documented in the git commit history.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#
# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso

e95010a9c0bad33cca21d762dd1151167993fd37 # 2025-10-21 09:56:26 -0500
# Re-pgindent brin.c.

e1c1c30f635390b6a3ae4993e8cac213a33e6e3f # 2021-06-28 11:05:54 -0400
# Pre branch pgindent / pgperltidy run

Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PostgreSQL 14.19.
# Generated by GNU Autoconf 2.69 for PostgreSQL 14.20.
#
# Report bugs to <pgsql-bugs@lists.postgresql.org>.
#
Expand Down Expand Up @@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='14.19'
PACKAGE_STRING='PostgreSQL 14.19'
PACKAGE_VERSION='14.20'
PACKAGE_STRING='PostgreSQL 14.20'
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
PACKAGE_URL='https://www.postgresql.org/'

Expand Down Expand Up @@ -1445,7 +1445,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PostgreSQL 14.19 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 14.20 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1510,7 +1510,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PostgreSQL 14.19:";;
short | recursive ) echo "Configuration of PostgreSQL 14.20:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1682,7 +1682,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PostgreSQL configure 14.19
PostgreSQL configure 14.20
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2435,7 +2435,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by PostgreSQL $as_me 14.19, which was
It was created by PostgreSQL $as_me 14.20, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -20763,7 +20763,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PostgreSQL $as_me 14.19, which was
This file was extended by PostgreSQL $as_me 14.20, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20834,7 +20834,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PostgreSQL config.status 14.19
PostgreSQL config.status 14.20
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros

AC_INIT([PostgreSQL], [14.19], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [14.20], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])

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
Expand Down
3 changes: 3 additions & 0 deletions contrib/pg_buffercache/pg_buffercache_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "access/htup_details.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/buf_internals.h"
#include "storage/bufmgr.h"

Expand Down Expand Up @@ -148,6 +149,8 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
BufferDesc *bufHdr;
uint32 buf_state;

CHECK_FOR_INTERRUPTS();

bufHdr = GetBufferDescriptor(i);
/* Lock each buffer header before inspecting. */
buf_state = LockBufHdr(bufHdr);
Expand Down
47 changes: 44 additions & 3 deletions contrib/pg_prewarm/pg_prewarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
#include <unistd.h>

#include "access/relation.h"
#include "catalog/index.h"
#include "fmgr.h"
#include "miscadmin.h"
#include "optimizer/cost.h"
#include "storage/bufmgr.h"
#include "storage/lmgr.h"
#include "storage/smgr.h"
#include "utils/acl.h"
#include "utils/builtins.h"
Expand Down Expand Up @@ -69,6 +71,8 @@ pg_prewarm(PG_FUNCTION_ARGS)
char *ttype;
PrewarmType ptype;
AclResult aclresult;
char relkind;
Oid privOid;

/* Basic sanity checking. */
if (PG_ARGISNULL(0))
Expand Down Expand Up @@ -104,9 +108,43 @@ pg_prewarm(PG_FUNCTION_ARGS)
forkString = text_to_cstring(forkName);
forkNumber = forkname_to_number(forkString);

/* Open relation and check privileges. */
/*
* Open relation and check privileges. If the relation is an index, we
* must check the privileges on its parent table instead.
*/
relkind = get_rel_relkind(relOid);
if (relkind == RELKIND_INDEX ||
relkind == RELKIND_PARTITIONED_INDEX)
{
privOid = IndexGetRelation(relOid, true);

/* Lock table before index to avoid deadlock. */
if (OidIsValid(privOid))
LockRelationOid(privOid, AccessShareLock);
}
else
privOid = relOid;

rel = relation_open(relOid, AccessShareLock);
aclresult = pg_class_aclcheck(relOid, GetUserId(), ACL_SELECT);

/*
* It's possible that the relation with OID "privOid" was dropped and the
* OID was reused before we locked it. If that happens, we could be left
* with the wrong parent table OID, in which case we must ERROR. It's
* possible that such a race would change the outcome of
* get_rel_relkind(), too, but the worst case scenario there is that we'll
* check privileges on the index instead of its parent table, which isn't
* too terrible.
*/
if (!OidIsValid(privOid) ||
(privOid != relOid &&
privOid != IndexGetRelation(relOid, true)))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_TABLE),
errmsg("could not find parent table of index \"%s\"",
RelationGetRelationName(rel))));

aclresult = pg_class_aclcheck(privOid, GetUserId(), ACL_SELECT);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, get_relkind_objtype(rel->rd_rel->relkind), get_rel_name(relOid));

Expand Down Expand Up @@ -211,8 +249,11 @@ pg_prewarm(PG_FUNCTION_ARGS)
}
}

/* Close relation, release lock. */
/* Close relation, release locks. */
relation_close(rel, AccessShareLock);

if (privOid != relOid)
UnlockRelationOid(privOid, AccessShareLock);

PG_RETURN_INT64(blocks_done);
}
46 changes: 46 additions & 0 deletions contrib/pg_trgm/expected/pg_trgm.out
Original file line number Diff line number Diff line change
Expand Up @@ -4693,6 +4693,23 @@ select count(*) from test_trgm where t like '%99%' and t like '%qw%';
19
(1 row)

explain (costs off)
select count(*) from test_trgm where t %> '' and t %> '%qwerty%';
QUERY PLAN
-------------------------------------------------------------------------
Aggregate
-> Bitmap Heap Scan on test_trgm
Recheck Cond: ((t %> ''::text) AND (t %> '%qwerty%'::text))
-> Bitmap Index Scan on trgm_idx
Index Cond: ((t %> ''::text) AND (t %> '%qwerty%'::text))
(5 rows)

select count(*) from test_trgm where t %> '' and t %> '%qwerty%';
count
-------
0
(1 row)

-- ensure that pending-list items are handled correctly, too
create temp table t_test_trgm(t text COLLATE "C");
create index t_trgm_idx on t_test_trgm using gin (t gin_trgm_ops);
Expand Down Expand Up @@ -4731,6 +4748,23 @@ select count(*) from t_test_trgm where t like '%99%' and t like '%qw%';
1
(1 row)

explain (costs off)
select count(*) from t_test_trgm where t %> '' and t %> '%qwerty%';
QUERY PLAN
-------------------------------------------------------------------------
Aggregate
-> Bitmap Heap Scan on t_test_trgm
Recheck Cond: ((t %> ''::text) AND (t %> '%qwerty%'::text))
-> Bitmap Index Scan on t_trgm_idx
Index Cond: ((t %> ''::text) AND (t %> '%qwerty%'::text))
(5 rows)

select count(*) from t_test_trgm where t %> '' and t %> '%qwerty%';
count
-------
0
(1 row)

-- run the same queries with sequential scan to check the results
set enable_bitmapscan=off;
set enable_seqscan=on;
Expand All @@ -4746,6 +4780,12 @@ select count(*) from test_trgm where t like '%99%' and t like '%qw%';
19
(1 row)

select count(*) from test_trgm where t %> '' and t %> '%qwerty%';
count
-------
0
(1 row)

select count(*) from t_test_trgm where t like '%99%' and t like '%qwerty%';
count
-------
Expand All @@ -4758,6 +4798,12 @@ select count(*) from t_test_trgm where t like '%99%' and t like '%qw%';
1
(1 row)

select count(*) from t_test_trgm where t %> '' and t %> '%qwerty%';
count
-------
0
(1 row)

reset enable_bitmapscan;
create table test2(t text COLLATE "C");
insert into test2 values ('abcdef');
Expand Down
8 changes: 8 additions & 0 deletions contrib/pg_trgm/sql/pg_trgm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ select count(*) from test_trgm where t like '%99%' and t like '%qwerty%';
explain (costs off)
select count(*) from test_trgm where t like '%99%' and t like '%qw%';
select count(*) from test_trgm where t like '%99%' and t like '%qw%';
explain (costs off)
select count(*) from test_trgm where t %> '' and t %> '%qwerty%';
select count(*) from test_trgm where t %> '' and t %> '%qwerty%';
-- ensure that pending-list items are handled correctly, too
create temp table t_test_trgm(t text COLLATE "C");
create index t_trgm_idx on t_test_trgm using gin (t gin_trgm_ops);
Expand All @@ -90,14 +93,19 @@ select count(*) from t_test_trgm where t like '%99%' and t like '%qwerty%';
explain (costs off)
select count(*) from t_test_trgm where t like '%99%' and t like '%qw%';
select count(*) from t_test_trgm where t like '%99%' and t like '%qw%';
explain (costs off)
select count(*) from t_test_trgm where t %> '' and t %> '%qwerty%';
select count(*) from t_test_trgm where t %> '' and t %> '%qwerty%';

-- run the same queries with sequential scan to check the results
set enable_bitmapscan=off;
set enable_seqscan=on;
select count(*) from test_trgm where t like '%99%' and t like '%qwerty%';
select count(*) from test_trgm where t like '%99%' and t like '%qw%';
select count(*) from test_trgm where t %> '' and t %> '%qwerty%';
select count(*) from t_test_trgm where t like '%99%' and t like '%qwerty%';
select count(*) from t_test_trgm where t like '%99%' and t like '%qw%';
select count(*) from t_test_trgm where t %> '' and t %> '%qwerty%';
reset enable_bitmapscan;

create table test2(t text COLLATE "C");
Expand Down
32 changes: 22 additions & 10 deletions contrib/pgstattuple/pgstattuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,
/* fully empty page */
stat->free_space += BLCKSZ;
}
else
else if (PageGetSpecialSize(page) == MAXALIGN(sizeof(BTPageOpaqueData)))
{
BTPageOpaque opaque;

Expand Down Expand Up @@ -468,10 +468,16 @@ pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,
Buffer buf;
Page page;

buf = _hash_getbuf_with_strategy(rel, blkno, HASH_READ, 0, bstrategy);
buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL, bstrategy);
LockBuffer(buf, HASH_READ);
page = BufferGetPage(buf);

if (PageGetSpecialSize(page) == MAXALIGN(sizeof(HashPageOpaqueData)))
if (PageIsNew(page))
{
/* fully empty page */
stat->free_space += BLCKSZ;
}
else if (PageGetSpecialSize(page) == MAXALIGN(sizeof(HashPageOpaqueData)))
{
HashPageOpaque opaque;

Expand Down Expand Up @@ -512,17 +518,23 @@ pgstat_gist_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,

buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL, bstrategy);
LockBuffer(buf, GIST_SHARE);
gistcheckpage(rel, buf);
page = BufferGetPage(buf);

if (GistPageIsLeaf(page))
if (PageIsNew(page))
{
pgstat_index_page(stat, page, FirstOffsetNumber,
PageGetMaxOffsetNumber(page));
/* fully empty page */
stat->free_space += BLCKSZ;
}
else
else if (PageGetSpecialSize(page) == MAXALIGN(sizeof(GISTPageOpaqueData)))
{
/* root or node */
if (GistPageIsLeaf(page))
{
pgstat_index_page(stat, page, FirstOffsetNumber,
PageGetMaxOffsetNumber(page));
}
else
{
/* root or node */
}
}

UnlockReleaseBuffer(buf);
Expand Down
2 changes: 2 additions & 0 deletions contrib/postgres_fdw/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Generated subdirectories
/log/
/results/
/output_iso/
/tmp_check/
/tmp_check_iso/
2 changes: 2 additions & 0 deletions contrib/postgres_fdw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ EXTENSION = postgres_fdw
DATA = postgres_fdw--1.0.sql postgres_fdw--1.0--1.1.sql

REGRESS = postgres_fdw
ISOLATION = eval_plan_qual
ISOLATION_OPTS = --load-extension=postgres_fdw

ifdef USE_PGXS
PG_CONFIG = pg_config
Expand Down
Loading