Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT SQUASH MERGE] Community Merge for 3_X #492

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
4f4e187
Make fallback MD5 implementation thread-safe on big-endian systems
hlinnaka Aug 7, 2024
a808a94
Fix edge case in plpgsql's make_callstmt_target().
tglsfdc Aug 7, 2024
7ce0948
Revert ECPG's use of pnstrdup()
petere Aug 7, 2024
e03341c
Fix pg_rewind debug output to print the source timeline history
hlinnaka Aug 8, 2024
af94ca5
Refuse ATTACH of a table referenced by a foreign key
alvherre Aug 8, 2024
e0ba68b
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.
tglsfdc Aug 9, 2024
113c70b
doc: Fix name of CRC algorithm in "Reliability" section.
nathan-bossart Aug 9, 2024
71838e4
Allow adjusting session_authorization and role in parallel workers.
tglsfdc Aug 10, 2024
701725b
Suppress Coverity warnings about Asserts in get_name_for_var_field.
tglsfdc Aug 11, 2024
5431c09
Fix creation of partition descriptor during concurrent detach+drop
alvherre Aug 12, 2024
754973d
docs: fix incorrect plpgsql error message
bmomjian Aug 17, 2024
5f5f8e6
Fix DROP DATABASE for databases with many ACLs
tvondra Aug 18, 2024
0b8ddad
ci: Upgrade MacPorts version to 2.10.1.
macdice Aug 18, 2024
933de26
Fix harmless LC_COLLATE[_MASK] confusion.
macdice Aug 19, 2024
c43b5a0
Fix regression in TLS session ticket disabling
danielgustafsson Aug 19, 2024
394edec
Explain dropdb can't use syscache because of TOAST
tvondra Aug 19, 2024
c02588e
Avoid failure to open dropped detached partition
alvherre Aug 19, 2024
eec9208
Document limit on the number of out-of-line values per table
j-naylor Aug 20, 2024
28c7426
Fix a couple of wait event descriptions.
nathan-bossart Aug 20, 2024
148885e
Disallow USING clause when altering type of generated column
petere Aug 29, 2024
fd8f0fb
Clarify restrict_nonsystem_relation_kind description.
MasahikoSawada Aug 30, 2024
899e990
Stabilize 039_end_of_wal test.
macdice Aug 31, 2024
8f69b76
Prevent mis-encoding of "trailing junk after numeric literal" errors.
tglsfdc Sep 5, 2024
e025f6c
Fix waits of REINDEX CONCURRENTLY for indexes with predicates or expr…
michaelpq Sep 9, 2024
bafc263
Remove incorrect Assert.
tglsfdc Sep 11, 2024
a36bde1
Reintroduce support for sequences in pgstattuple and pageinspect.
nathan-bossart Sep 12, 2024
9d6af52
Fix contrib/pageinspect's test for sequences.
nathan-bossart Sep 13, 2024
167bf3e
Allow _h_indexbuild() to be interrupted.
tglsfdc Sep 13, 2024
60bbde5
Only define NO_THREAD_SAFE_LOCALE for MSVC plperl when required
adunstan Sep 14, 2024
584e156
Run regression tests with timezone America/Los_Angeles.
tglsfdc Sep 14, 2024
8834f93
doc PG relnotes: add attribution for time zone data files items
bmomjian Sep 14, 2024
77d0d98
Replace usages of xmlXPathCompile() with xmlXPathCtxtCompile().
tglsfdc Sep 15, 2024
3e7df14
scripts: add Perl script to add links to release notes
bmomjian Sep 16, 2024
6e912d5
doc PG relnotes: add links to commits
bmomjian Sep 16, 2024
2e0ec5a
doc PG relnotes: fix SGML markup for new commit links
bmomjian Sep 16, 2024
75072d2
Repair pg_upgrade for identity sequences with non-default persistence.
tglsfdc Sep 17, 2024
60e3c70
Add missing query ID reporting in extended query protocol
michaelpq Sep 18, 2024
035c651
Don't enter parallel mode when holding interrupts.
nmisch Sep 18, 2024
d89e8c5
doc PG relnotes: no relnote footnotes for commit links in PDF
bmomjian Sep 18, 2024
ff7405b
doc PG relnotes: add paragraph explaining the section symbol
bmomjian Sep 18, 2024
5bc58c1
Improve Perl script which adds commit links to release notes
bmomjian Sep 19, 2024
d5a5247
doc PG relnotes: rename commit link paragraph for clarity
bmomjian Sep 19, 2024
0e5159a
doc PG relnotes: document "Unresolved ID reference found" cause
bmomjian Sep 19, 2024
23a67c1
doc PG relnotes: remove warning about commit links in PDF build
bmomjian Sep 19, 2024
eb18127
Doc: explain how to test ADMIN privilege with pg_has_role().
tglsfdc Sep 20, 2024
3645d3a
Drop global objects after completed test
danielgustafsson Apr 3, 2024
187b5d5
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.
nmisch Sep 24, 2024
d206903
Fix data loss at inplace update after heap_update().
nmisch Sep 24, 2024
6e22912
For inplace update durability, make heap_update() callers wait.
nmisch Sep 24, 2024
35fb3e4
Fix use of uninitialized value in previous commit.
nmisch Sep 25, 2024
c37a33e
vacuumdb: Skip temporary tables in query to build list of relations
michaelpq Sep 25, 2024
cf8892a
tests: Restrict pg_locks queries in advisory_locks.sql to current dat…
anarazel Oct 5, 2022
e73df32
Fix incorrect memory access in VACUUM FULL with invalid toast indexes
michaelpq Sep 27, 2024
e065189
Avoid 037_invalid_database.pl hang under debug_discard_caches.
nmisch Sep 27, 2024
76de81d
Remove NULL dereference from RenameRelationInternal().
nmisch Sep 29, 2024
c2aa60b
reindexdb: Skip reindexing temporary tables and indexes.
MasaoFujii Sep 30, 2024
40bca3a
Bump MIN_WINNT for MINGW to clear a build error
adunstan Sep 30, 2024
d2e0b2a
Doc: replace unnecessary non-breaking space with ordinal space.
tatsuo-ishii Oct 1, 2024
6d8b52f
Fix race condition in COMMIT PREPARED causing orphaned 2PC files
michaelpq Oct 1, 2024
04a257c
Parse libpq's "keepalives" option more like other integer options.
tglsfdc Oct 2, 2024
0e0e52d
Ignore not-yet-defined Portals in pg_cursors view.
tglsfdc Oct 6, 2024
445c436
Fix fetching default toast value during decoding of in-progress trans…
Oct 7, 2024
f8b357d
Fix Y2038 issues with MyStartTime.
nathan-bossart Oct 7, 2024
75fd05c
vacuumdb: Schema-qualify operator in catalog query's WHERE clause.
nathan-bossart Oct 7, 2024
79c6fe4
Stabilize the test added by commit 022564f60c.
Oct 8, 2024
9834b33
Remove incorrect function import from pgindent
danielgustafsson Oct 9, 2024
96dce89
Correctly identify which EC members are computable at a plan node.
tglsfdc Oct 12, 2024
d4f3d53
Reduce memory block size for decoded tuple storage to 8kB.
MasahikoSawada Oct 16, 2024
1811943
Further refine _SPI_execute_plan's rule for atomic execution.
tglsfdc Oct 16, 2024
ecbcb9c
Fix extreme skew detection in Parallel Hash Join.
macdice Oct 17, 2024
6fc696a
Adjust documentation for configuring Linux huge pages.
nathan-bossart Oct 18, 2024
8c93959
Note that index_name in ALTER INDEX ATTACH PARTITION can be schema-qu…
alvherre Oct 20, 2024
d9dac27
Fix race condition in committing a serializable transaction
hlinnaka Oct 21, 2024
8ea4976
Fix wrong assertion and poor error messages in "COPY (query) TO".
tglsfdc Oct 21, 2024
e702881
Restructure foreign key handling code for ATTACH/DETACH
alvherre Oct 22, 2024
7280495
ecpg: Fix out-of-bound read in DecodeDateTime()
michaelpq Oct 22, 2024
610dcfe
Remove unnecessary word in a comment
amitlan Oct 23, 2024
68dac0d
Stop reading uninitialized memory in heap_inplace_lock().
nmisch Oct 24, 2024
9d6af26
At end of recovery, reset all sinval-managed caches.
nmisch Oct 25, 2024
f51d0a1
For inplace update, send nontransactional invalidations.
nmisch Oct 25, 2024
6a04d9a
WAL-log inplace update before revealing it to other sessions.
nmisch Oct 25, 2024
c8e099e
Fix overflow in bsearch_arg() with more than INT_MAX elements
hlinnaka Oct 28, 2024
15219b0
Guard against enormously long input in pg_saslprep().
tglsfdc Oct 28, 2024
a86f999
Doc: clarify enable_indexscan=off also disabled Index Only Scans
david-rowley Oct 29, 2024
a7f3bee
doc: Add better description for rewrite functions in event triggers
michaelpq Oct 29, 2024
ae033b9
Update time zone data files to tzdata release 2024b.
tglsfdc Oct 29, 2024
1f8b2a2
Unpin buffer before inplace update waits for an XID to end.
nmisch Oct 29, 2024
8ccafde
Fix some more bugs in foreign keys connecting partitioned tables
alvherre Oct 30, 2024
b2ca2f2
doc: remove mention of ActiveState for Perl and Tcl on Windows
bmomjian Nov 1, 2024
3cbaff0
doc: fix ALTER DOMAIN domain_constraint to spell out options
bmomjian Nov 1, 2024
ab53db9
Revert "WAL-log inplace update before revealing it to other sessions."
nmisch Nov 2, 2024
7a45ba3
Revert "For inplace update, send nontransactional invalidations."
nmisch Nov 2, 2024
0574b6e
Move I/O before the index_update_stats() buffer lock region.
nmisch Nov 2, 2024
1d01334
Suppress new "may be used uninitialized" warning.
nmisch Nov 3, 2024
3af79f4
Clear padding of PgStat_HashKey when handling pgstats entries
michaelpq Nov 5, 2024
6a3d472
Monkey-patch LLVM code to fix ARM relocation bug.
macdice Nov 6, 2024
7e3d62e
doc: Reword ALTER TABLE ATTACH restriction on NO INHERIT constraints
alvherre Nov 7, 2024
e67809f
Provide lstat() for Windows.
macdice Aug 6, 2022
c093542
Fix lstat() for broken junction points on Windows.
macdice Oct 25, 2022
2766a17
Replace pgwin32_is_junction() with lstat().
macdice Aug 6, 2022
c4fe7e7
Make unlink() work for junction points on Windows.
macdice Aug 6, 2022
b356ff7
Message style improvement
petere Nov 8, 2024
b89ec91
Disallow partitionwise grouping when collations don't match
amitlan Nov 8, 2024
69a01c8
Disallow partitionwise join when collations don't match
amitlan Nov 8, 2024
4fe6a88
Improve fix for not entering parallel mode when holding interrupts.
tglsfdc Nov 8, 2024
6c5202e
Release notes for 17.1, 16.5, 15.9, 14.14, 13.17, 12.21.
tglsfdc Nov 10, 2024
7ca211c
libpq: Bail out during SSL/GSS negotiation errors
michaelpq Nov 11, 2024
31bdd9e
Translation updates
petere Nov 11, 2024
3fc68a9
Block environment variable mutations from trusted PL/Perl.
nmisch Nov 11, 2024
407f45f
Ensure cached plans are correctly marked as dependent on role.
nathan-bossart Nov 11, 2024
a0cc0d5
Fix improper interactions between session_authorization and role.
tglsfdc Nov 11, 2024
d52808f
src/tools/msvc: Respect REGRESS_OPTS in plcheck.
nmisch Nov 11, 2024
d349040
Fix cross-version upgrade tests.
tglsfdc Nov 11, 2024
04eae66
Parallel workers use AuthenticatedUserId for connection privilege che…
tglsfdc Nov 11, 2024
be8738d
Last-minute updates for release notes.
tglsfdc Nov 11, 2024
4d6f8cf
Stamp 15.9.
tglsfdc Nov 11, 2024
135b951
Fix arrays comparison in CompareOpclassOptions()
akorotkov Nov 11, 2024
6d7d6fd
Count contrib/bloom index scans in pgstat view.
petergeoghegan Nov 13, 2024
7c6d3fc
Fix race conditions with drop of reused pgstats entries
michaelpq Nov 15, 2024
b338472
Avoid deleting critical WAL segments during pg_rewind
alvherre Nov 15, 2024
5c54260
Avoid assertion due to disconnected NFA sub-graphs in regex parsing.
tglsfdc Nov 15, 2024
de6825f
Fix a possibility of logical replication slot's restart_lsn going bac…
MasahikoSawada Nov 16, 2024
59bb464
Fix per-session activation of ALTER {ROLE|DATABASE} SET role.
nmisch Nov 16, 2024
4fd25ae
Undo unintentional ABI break in struct ResultRelInfo.
tglsfdc Nov 16, 2024
c7ef70e
Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22.
tglsfdc Nov 16, 2024
b94c22c
Fix recently-exposed portability issue in regex optimization.
tglsfdc Nov 17, 2024
4a2548f
Stamp 15.10.
tglsfdc Nov 18, 2024
6e32931
BABEL: Fixes after community commit 7abe267
Sep 26, 2024
c7cbb91
BABEL: Fix crash when creating index on Babelfish temp table.
timchang514 Sep 30, 2024
d2152f5
BABEL: Skip locking the tuple for ENR-related tuple modifications.
Oct 8, 2024
ba0f75f
BABEL: fix babelfish commit/rollback inside subtransaction post commi…
tanscorpio7 Oct 24, 2024
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
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 15.8.
# Generated by GNU Autoconf 2.69 for PostgreSQL 15.10.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='15.8'
PACKAGE_STRING='PostgreSQL 15.8'
PACKAGE_VERSION='15.10'
PACKAGE_STRING='PostgreSQL 15.10'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL='https://www.postgresql.org/'

Expand Down Expand Up @@ -1452,7 +1452,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 15.8 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 15.10 to adapt to many kinds of systems.

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

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

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

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

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2444,7 +2444,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 15.8, which was
It was created by PostgreSQL $as_me 15.10, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -20775,7 +20775,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 15.8, which was
This file was extended by PostgreSQL $as_me 15.10, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20846,7 +20846,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 15.8
PostgreSQL config.status 15.10
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], [15.8], [[email protected]], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [15.10], [[email protected]], [], [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
1 change: 1 addition & 0 deletions contrib/bloom/blscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
*/
bas = GetAccessStrategy(BAS_BULKREAD);
npages = RelationGetNumberOfBlocks(scan->indexRelation);
pgstat_count_index_scan(scan->indexRelation);

for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
{
Expand Down
10 changes: 10 additions & 0 deletions contrib/pageinspect/expected/page.out
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,13 @@ SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);

(1 row)

-- tests for sequences
create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
tuple_data_split
-------------------------------------------------------
{"\\x0100000000000001","\\x0000000000000000","\\x00"}
(1 row)

drop sequence test_sequence;
6 changes: 5 additions & 1 deletion contrib/pageinspect/heapfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,11 @@ tuple_data_split_internal(Oid relid, char *tupdata,
raw_attrs = initArrayResult(BYTEAOID, CurrentMemoryContext, false);
nattrs = tupdesc->natts;

if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
/*
* Sequences always use heap AM, but they don't show that in the catalogs.
*/
if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));

Expand Down
6 changes: 6 additions & 0 deletions contrib/pageinspect/sql/page.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ SHOW block_size \gset
SELECT fsm_page_contents(decode(repeat('00', :block_size), 'hex'));
SELECT page_header(decode(repeat('00', :block_size), 'hex'));
SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);

-- tests for sequences
create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
drop sequence test_sequence;
3 changes: 3 additions & 0 deletions contrib/pg_trgm/expected/pg_trgm.out
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,9 @@ ERROR: value 2025 out of bounds for option "siglen"
DETAIL: Valid values are between "1" and "2024".
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
set enable_seqscan=off;
-- check index compatibility handling when opclass option is specified
alter table test_trgm alter column t type varchar(768);
alter table test_trgm alter column t type text;
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
t | sml
-------------+----------
Expand Down
4 changes: 4 additions & 0 deletions contrib/pg_trgm/sql/pg_trgm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2025));
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
set enable_seqscan=off;

-- check index compatibility handling when opclass option is specified
alter table test_trgm alter column t type varchar(768);
alter table test_trgm alter column t type text;

select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
select t,similarity(t,'gwertyu0988') as sml from test_trgm where t % 'gwertyu0988' order by sml desc, t;
select t,similarity(t,'gwertyu1988') as sml from test_trgm where t % 'gwertyu1988' order by sml desc, t;
Expand Down
25 changes: 25 additions & 0 deletions contrib/pgstattuple/expected/pgstattuple.out
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,31 @@ select pgstathashindex('test_partition_hash_idx');
(4,8,0,1,0,0,0,100)
(1 row)

-- these should work for sequences
create sequence test_sequence;
select count(*) from pgstattuple('test_sequence');
count
-------
1
(1 row)

select pg_relpages('test_sequence');
pg_relpages
-------------
1
(1 row)

-- these should fail for sequences
select pgstatindex('test_sequence');
ERROR: relation "test_sequence" is not a btree index
select pgstatginindex('test_sequence');
ERROR: relation "test_sequence" is not a GIN index
select pgstathashindex('test_sequence');
ERROR: relation "test_sequence" is not a hash index
select pgstattuple_approx('test_sequence');
ERROR: relation "test_sequence" is of wrong relation kind
DETAIL: This operation is not supported for sequences.
drop sequence test_sequence;
drop table test_partitioned;
drop view test_view;
drop foreign table test_foreign_table;
Expand Down
6 changes: 5 additions & 1 deletion contrib/pgstattuple/pgstattuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
pgstattuple_type stat = {0};
SnapshotData SnapshotDirty;

if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
/*
* Sequences always use heap AM, but they don't show that in the catalogs.
*/
if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));
Expand Down
12 changes: 12 additions & 0 deletions contrib/pgstattuple/sql/pgstattuple.sql
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ create index test_partition_hash_idx on test_partition using hash (a);
select pgstatindex('test_partition_idx');
select pgstathashindex('test_partition_hash_idx');

-- these should work for sequences
create sequence test_sequence;
select count(*) from pgstattuple('test_sequence');
select pg_relpages('test_sequence');

-- these should fail for sequences
select pgstatindex('test_sequence');
select pgstatginindex('test_sequence');
select pgstathashindex('test_sequence');
select pgstattuple_approx('test_sequence');

drop sequence test_sequence;
drop table test_partitioned;
drop view test_view;
drop foreign table test_foreign_table;
Expand Down
2 changes: 1 addition & 1 deletion contrib/postgres_fdw/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ process_pgfdw_appname(const char *appname)
appendStringInfoString(&buf, application_name);
break;
case 'c':
appendStringInfo(&buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
appendStringInfo(&buf, "%" INT64_MODIFIER "x.%x", MyStartTime, MyProcPid);
break;
case 'C':
appendStringInfoString(&buf, cluster_name);
Expand Down
23 changes: 23 additions & 0 deletions contrib/test_decoding/expected/twophase.out
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,33 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
COMMIT
(3 rows)

-- Test that accessing a TOAST table is permitted during the decoding of a
-- prepared transaction.
-- Create a table with a column that uses a TOASTed default value.
-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
\set ECHO none
BEGIN;
INSERT INTO test_tab VALUES('test');
PREPARE TRANSACTION 'test_toast_table_access';
SELECT count(*) FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
count
-------
3
(1 row)

COMMIT PREPARED 'test_toast_table_access';
-- consume commit prepared
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
data
-------------------------------------------
COMMIT PREPARED 'test_toast_table_access'
(1 row)

-- Test 8:
-- cleanup and make sure results are also empty
DROP TABLE test_prepared1;
DROP TABLE test_prepared2;
DROP TABLE test_tab;
-- show results. There should be nothing to show
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data
Expand Down
22 changes: 22 additions & 0 deletions contrib/test_decoding/sql/twophase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,32 @@ COMMIT PREPARED 'test_prepared_nodecode';
-- should be decoded now
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');

-- Test that accessing a TOAST table is permitted during the decoding of a
-- prepared transaction.

-- Create a table with a column that uses a TOASTed default value.
-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
\set ECHO none
SELECT 'CREATE TABLE test_tab (a text DEFAULT ''' || string_agg('toast value', '') || ''');' FROM generate_series(1, 4000)
\gexec
\set ECHO all

BEGIN;
INSERT INTO test_tab VALUES('test');
PREPARE TRANSACTION 'test_toast_table_access';

SELECT count(*) FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');

COMMIT PREPARED 'test_toast_table_access';

-- consume commit prepared
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');

-- Test 8:
-- cleanup and make sure results are also empty
DROP TABLE test_prepared1;
DROP TABLE test_prepared2;
DROP TABLE test_tab;
-- show results. There should be nothing to show
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');

Expand Down
4 changes: 2 additions & 2 deletions contrib/xml2/xpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ pgxml_xpath(text *document, xmlChar *xpath, xpath_workspace *workspace)
workspace->ctxt->node = xmlDocGetRootElement(workspace->doctree);

/* compile the path */
comppath = xmlXPathCompile(xpath);
comppath = xmlXPathCtxtCompile(workspace->ctxt, xpath);
if (comppath == NULL)
xml_ereport(xmlerrcxt, ERROR, ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
"XPath Syntax Error");
Expand Down Expand Up @@ -650,7 +650,7 @@ xpath_table(PG_FUNCTION_ARGS)
ctxt->node = xmlDocGetRootElement(doctree);

/* compile the path */
comppath = xmlXPathCompile(xpaths[j]);
comppath = xmlXPathCtxtCompile(ctxt, xpaths[j]);
if (comppath == NULL)
xml_ereport(xmlerrcxt, ERROR,
ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
Expand Down
15 changes: 9 additions & 6 deletions doc/src/sgml/config.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -5114,8 +5114,9 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
</term>
<listitem>
<para>
Enables or disables the query planner's use of index-scan plan
types. The default is <literal>on</literal>.
Enables or disables the query planner's use of index-scan and
index-only-scan plan types. The default is <literal>on</literal>.
Also see <xref linkend="guc-enable-indexonlyscan"/>.
</para>
</listitem>
</varlistentry>
Expand All @@ -5130,7 +5131,9 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<para>
Enables or disables the query planner's use of index-only-scan plan
types (see <xref linkend="indexes-index-only-scans"/>).
The default is <literal>on</literal>.
The default is <literal>on</literal>. The
<xref linkend="guc-enable-indexscan"/> setting must also be
enabled to have the query planner consider index-only-scans.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -9394,9 +9397,9 @@ SET XML OPTION { DOCUMENT | CONTENT };
</term>
<listitem>
<para>
This variable specifies relation kind to which access is restricted.
It contains a comma-separated list of relation kind. Currently, the
supported relation kinds are <literal>view</literal> and
Set relation kinds for which access to non-system relations is prohibited.
The value takes the form of a comma-separated list of relation kinds.
Currently, the supported relation kinds are <literal>view</literal> and
<literal>foreign-table</literal>.
</para>
</listitem>
Expand Down
5 changes: 5 additions & 0 deletions doc/src/sgml/event-trigger.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
control statements are available to rewrite a table,
like <literal>CLUSTER</literal> and <literal>VACUUM</literal>,
the <literal>table_rewrite</literal> event is not triggered by them.
To find the OID of the table that was rewritten, use the function
<literal>pg_event_trigger_table_rewrite_oid()</literal> (see
<xref linkend="functions-event-triggers"/>). To discover the reason(s)
for the rewrite, use the function
<literal>pg_event_trigger_table_rewrite_reason()</literal>.
</para>

<para>
Expand Down
12 changes: 10 additions & 2 deletions doc/src/sgml/func.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -23030,6 +23030,10 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
the role (that is, the right to do <command>SET ROLE</command>), while
<literal>USAGE</literal> denotes whether the privileges of the role
are immediately available without doing <command>SET ROLE</command>.
<literal>WITH ADMIN OPTION</literal> or <literal>WITH GRANT
OPTION</literal> can be added to either of these privilege types to
test whether the <literal>ADMIN</literal> privilege is held (all
four spellings test the same thing).
This function does not allow the special case of
setting <parameter>user</parameter> to <literal>public</literal>,
because the PUBLIC pseudo-role can never be a member of real roles.
Expand Down Expand Up @@ -28353,8 +28357,12 @@ CREATE EVENT TRIGGER test_event_trigger_for_drops
<returnvalue>integer</returnvalue>
</para>
<para>
Returns a code explaining the reason(s) for rewriting. The exact
meaning of the codes is release dependent.
Returns a code explaining the reason(s) for rewriting. The value is
a bitmap built from the following values: <literal>1</literal>
(the table has changed its persistence), <literal>2</literal>
(default value of a column has changed), <literal>4</literal>
(a column has a new data type) and <literal>8</literal>
(the table access method has changed).
</para></entry>
</row>
</tbody>
Expand Down
Loading
Loading