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_8 stable #498

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
cd74e6f
Make fallback MD5 implementation thread-safe on big-endian systems
hlinnaka Aug 7, 2024
92b3c44
Fix edge case in plpgsql's make_callstmt_target().
tglsfdc Aug 7, 2024
0528d00
Revert ECPG's use of pnstrdup()
petere Aug 7, 2024
f808237
Fix pg_rewind debug output to print the source timeline history
hlinnaka Aug 8, 2024
fe44685
Refuse ATTACH of a table referenced by a foreign key
alvherre Aug 8, 2024
1034d4a
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.
tglsfdc Aug 9, 2024
7b7aa98
doc: Fix name of CRC algorithm in "Reliability" section.
nathan-bossart Aug 9, 2024
6b6a1f3
Allow adjusting session_authorization and role in parallel workers.
tglsfdc Aug 10, 2024
e5c4ad1
Suppress Coverity warnings about Asserts in get_name_for_var_field.
tglsfdc Aug 11, 2024
9a24aa2
Fix creation of partition descriptor during concurrent detach+drop
alvherre Aug 12, 2024
49abee4
docs: fix incorrect plpgsql error message
bmomjian Aug 17, 2024
17a4d14
Fix DROP DATABASE for databases with many ACLs
tvondra Aug 18, 2024
a96c41d
ci: Upgrade MacPorts version to 2.10.1.
macdice Aug 18, 2024
2e5bc2d
Fix harmless LC_COLLATE[_MASK] confusion.
macdice Aug 19, 2024
11b3955
Fix regression in TLS session ticket disabling
danielgustafsson Aug 19, 2024
fc455c3
Explain dropdb can't use syscache because of TOAST
tvondra Aug 19, 2024
bf35f4b
Avoid failure to open dropped detached partition
alvherre Aug 19, 2024
ed7cba1
Document limit on the number of out-of-line values per table
j-naylor Aug 20, 2024
2a996f1
Fix a couple of wait event descriptions.
nathan-bossart Aug 20, 2024
9d52e95
Disallow USING clause when altering type of generated column
petere Aug 29, 2024
44af960
Clarify restrict_nonsystem_relation_kind description.
MasahikoSawada Aug 30, 2024
6b2bf1a
Stabilize 039_end_of_wal test.
macdice Aug 31, 2024
10f7226
Prevent mis-encoding of "trailing junk after numeric literal" errors.
tglsfdc Sep 5, 2024
3ac2659
Fix waits of REINDEX CONCURRENTLY for indexes with predicates or expr…
michaelpq Sep 9, 2024
e90627a
Remove incorrect Assert.
tglsfdc Sep 11, 2024
f08b9ab
Reintroduce support for sequences in pgstattuple and pageinspect.
nathan-bossart Sep 12, 2024
27a96f7
Fix contrib/pageinspect's test for sequences.
nathan-bossart Sep 13, 2024
ac67504
Allow _h_indexbuild() to be interrupted.
tglsfdc Sep 13, 2024
af667a5
Only define NO_THREAD_SAFE_LOCALE for MSVC plperl when required
adunstan Sep 14, 2024
272ddd8
Run regression tests with timezone America/Los_Angeles.
tglsfdc Sep 14, 2024
5d347c8
doc PG relnotes: add attribution for time zone data files items
bmomjian Sep 14, 2024
5968be2
Replace usages of xmlXPathCompile() with xmlXPathCtxtCompile().
tglsfdc Sep 15, 2024
dbca896
scripts: add Perl script to add links to release notes
bmomjian Sep 16, 2024
fb407ba
doc PG relnotes: add links to commits
bmomjian Sep 16, 2024
b87c93f
doc PG relnotes: fix SGML markup for new commit links
bmomjian Sep 16, 2024
45985de
Repair pg_upgrade for identity sequences with non-default persistence.
tglsfdc Sep 17, 2024
2d6e548
Add missing query ID reporting in extended query protocol
michaelpq Sep 18, 2024
52dfd50
Don't enter parallel mode when holding interrupts.
nmisch Sep 18, 2024
a43eb48
doc PG relnotes: no relnote footnotes for commit links in PDF
bmomjian Sep 18, 2024
0dbee69
doc PG relnotes: add paragraph explaining the section symbol
bmomjian Sep 18, 2024
2aaf0f4
Improve Perl script which adds commit links to release notes
bmomjian Sep 19, 2024
646e53b
doc PG relnotes: rename commit link paragraph for clarity
bmomjian Sep 19, 2024
4f5ab16
doc PG relnotes: document "Unresolved ID reference found" cause
bmomjian Sep 19, 2024
210e44b
doc PG relnotes: remove warning about commit links in PDF build
bmomjian Sep 19, 2024
9a85f8b
Doc: explain how to test ADMIN privilege with pg_has_role().
tglsfdc Sep 20, 2024
3a84b57
Drop global objects after completed test
danielgustafsson Apr 3, 2024
008d0ec
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.
nmisch Sep 24, 2024
2a02321
Fix data loss at inplace update after heap_update().
nmisch Sep 24, 2024
cff4667
For inplace update durability, make heap_update() callers wait.
nmisch Sep 24, 2024
8f73aaa
Fix use of uninitialized value in previous commit.
nmisch Sep 25, 2024
9fce3b0
vacuumdb: Skip temporary tables in query to build list of relations
michaelpq Sep 25, 2024
ba497ca
tests: Restrict pg_locks queries in advisory_locks.sql to current dat…
anarazel Oct 5, 2022
b1c99da
Fix incorrect memory access in VACUUM FULL with invalid toast indexes
michaelpq Sep 27, 2024
1833dbc
Avoid 037_invalid_database.pl hang under debug_discard_caches.
nmisch Sep 27, 2024
2ad0c83
Remove NULL dereference from RenameRelationInternal().
nmisch Sep 29, 2024
4b32e23
reindexdb: Skip reindexing temporary tables and indexes.
MasaoFujii Sep 30, 2024
767ac88
Bump MIN_WINNT for MINGW to clear a build error
adunstan Sep 30, 2024
6d43f65
Doc: replace unnecessary non-breaking space with ordinal space.
tatsuo-ishii Oct 1, 2024
21fdd60
Fix race condition in COMMIT PREPARED causing orphaned 2PC files
michaelpq Oct 1, 2024
f63904a
Parse libpq's "keepalives" option more like other integer options.
tglsfdc Oct 2, 2024
d55a560
Ignore not-yet-defined Portals in pg_cursors view.
tglsfdc Oct 6, 2024
1a8dbe5
Fix fetching default toast value during decoding of in-progress trans…
Oct 7, 2024
63b36b1
Fix Y2038 issues with MyStartTime.
nathan-bossart Oct 7, 2024
a3e5f6e
vacuumdb: Schema-qualify operator in catalog query's WHERE clause.
nathan-bossart Oct 7, 2024
23698b5
Stabilize the test added by commit 022564f60c.
Oct 8, 2024
5fbe34c
Remove incorrect function import from pgindent
danielgustafsson Oct 9, 2024
275b38f
Correctly identify which EC members are computable at a plan node.
tglsfdc Oct 12, 2024
d5307f9
Reduce memory block size for decoded tuple storage to 8kB.
MasahikoSawada Oct 16, 2024
d34f272
Further refine _SPI_execute_plan's rule for atomic execution.
tglsfdc Oct 16, 2024
01d8dbd
Fix extreme skew detection in Parallel Hash Join.
macdice Oct 17, 2024
5691b2c
Adjust documentation for configuring Linux huge pages.
nathan-bossart Oct 18, 2024
0057a01
Note that index_name in ALTER INDEX ATTACH PARTITION can be schema-qu…
alvherre Oct 20, 2024
777432c
Fix race condition in committing a serializable transaction
hlinnaka Oct 21, 2024
44c291c
Fix wrong assertion and poor error messages in "COPY (query) TO".
tglsfdc Oct 21, 2024
31059a2
Restructure foreign key handling code for ATTACH/DETACH
alvherre Oct 22, 2024
0049160
ecpg: Fix out-of-bound read in DecodeDateTime()
michaelpq Oct 22, 2024
0b054e5
Remove unnecessary word in a comment
amitlan Oct 23, 2024
f5b34bf
Stop reading uninitialized memory in heap_inplace_lock().
nmisch Oct 24, 2024
cba7a3e
At end of recovery, reset all sinval-managed caches.
nmisch Oct 25, 2024
369f523
For inplace update, send nontransactional invalidations.
nmisch Oct 25, 2024
afa0a2b
WAL-log inplace update before revealing it to other sessions.
nmisch Oct 25, 2024
fafca5e
Fix overflow in bsearch_arg() with more than INT_MAX elements
hlinnaka Oct 28, 2024
3e0b780
Guard against enormously long input in pg_saslprep().
tglsfdc Oct 28, 2024
6610ed0
Doc: clarify enable_indexscan=off also disabled Index Only Scans
david-rowley Oct 29, 2024
b179c64
doc: Add better description for rewrite functions in event triggers
michaelpq Oct 29, 2024
a0d29db
Update time zone data files to tzdata release 2024b.
tglsfdc Oct 29, 2024
307d788
Unpin buffer before inplace update waits for an XID to end.
nmisch Oct 29, 2024
9d1c1ce
Fix some more bugs in foreign keys connecting partitioned tables
alvherre Oct 30, 2024
159395c
doc: remove mention of ActiveState for Perl and Tcl on Windows
bmomjian Nov 1, 2024
a5279f8
doc: fix ALTER DOMAIN domain_constraint to spell out options
bmomjian Nov 1, 2024
8ab6f55
Revert "WAL-log inplace update before revealing it to other sessions."
nmisch Nov 2, 2024
38c6798
Revert "For inplace update, send nontransactional invalidations."
nmisch Nov 2, 2024
8052fd7
Move I/O before the index_update_stats() buffer lock region.
nmisch Nov 2, 2024
33cc1eb
Suppress new "may be used uninitialized" warning.
nmisch Nov 3, 2024
b946957
Clear padding of PgStat_HashKey when handling pgstats entries
michaelpq Nov 5, 2024
56dabf5
Monkey-patch LLVM code to fix ARM relocation bug.
macdice Nov 6, 2024
018349f
doc: Reword ALTER TABLE ATTACH restriction on NO INHERIT constraints
alvherre Nov 7, 2024
1c19bdf
Provide lstat() for Windows.
macdice Aug 6, 2022
e841ffc
Fix lstat() for broken junction points on Windows.
macdice Oct 25, 2022
b8c5059
Replace pgwin32_is_junction() with lstat().
macdice Aug 6, 2022
4c6ef76
Make unlink() work for junction points on Windows.
macdice Aug 6, 2022
021a5fd
Message style improvement
petere Nov 8, 2024
c04c284
Disallow partitionwise grouping when collations don't match
amitlan Nov 8, 2024
6d4ef08
Disallow partitionwise join when collations don't match
amitlan Nov 8, 2024
f5ebefc
Improve fix for not entering parallel mode when holding interrupts.
tglsfdc Nov 8, 2024
aa83716
Release notes for 17.1, 16.5, 15.9, 14.14, 13.17, 12.21.
tglsfdc Nov 10, 2024
6461592
libpq: Bail out during SSL/GSS negotiation errors
michaelpq Nov 11, 2024
e99cc40
Translation updates
petere Nov 11, 2024
d9e123e
Block environment variable mutations from trusted PL/Perl.
nmisch Nov 11, 2024
a449cbf
Ensure cached plans are correctly marked as dependent on role.
nathan-bossart Nov 11, 2024
646afd2
Fix improper interactions between session_authorization and role.
tglsfdc Nov 11, 2024
a061760
src/tools/msvc: Respect REGRESS_OPTS in plcheck.
nmisch Nov 11, 2024
8dbd29a
Fix cross-version upgrade tests.
tglsfdc Nov 11, 2024
d9afaf3
Parallel workers use AuthenticatedUserId for connection privilege che…
tglsfdc Nov 11, 2024
718b0f9
Last-minute updates for release notes.
tglsfdc Nov 11, 2024
3a4150a
Stamp 15.9.
tglsfdc Nov 11, 2024
5219ef8
Fix arrays comparison in CompareOpclassOptions()
akorotkov Nov 11, 2024
f471351
Count contrib/bloom index scans in pgstat view.
petergeoghegan Nov 13, 2024
10854e1
Fix race conditions with drop of reused pgstats entries
michaelpq Nov 15, 2024
947d07c
Avoid deleting critical WAL segments during pg_rewind
alvherre Nov 15, 2024
235e70f
Avoid assertion due to disconnected NFA sub-graphs in regex parsing.
tglsfdc Nov 15, 2024
37b8310
Fix a possibility of logical replication slot's restart_lsn going bac…
MasahikoSawada Nov 16, 2024
d7e708b
Fix per-session activation of ALTER {ROLE|DATABASE} SET role.
nmisch Nov 16, 2024
faf38fb
Undo unintentional ABI break in struct ResultRelInfo.
tglsfdc Nov 16, 2024
3ca0078
Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22.
tglsfdc Nov 16, 2024
6260762
Fix recently-exposed portability issue in regex optimization.
tglsfdc Nov 17, 2024
593289c
Stamp 15.10.
tglsfdc Nov 18, 2024
d16d879
BABEL: Fixes after community commit 7abe267
Sep 26, 2024
60b7138
BABEL: Fix crash when creating index on Babelfish temp table.
timchang514 Sep 30, 2024
317c8e2
BABEL: Skip locking the tuple for ENR-related tuple modifications.
Oct 8, 2024
5f80c50
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