Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a272a58
Move FOR PORTION OF volatile check into planner
petere Jun 27, 2026
a40fdf6
Reject child partition FDWs in FOR PORTION OF
petere Jun 27, 2026
effb923
COPY TO FORMAT JSON: respect column list order
adunstan Jun 27, 2026
0cd17fd
Prevent inherited CHECK constraints from being weakened
adunstan Jun 27, 2026
d16be86
doc: Clarify inherited constraint behavior
adunstan Jun 27, 2026
f03ecd2
doc: Clarify ALTER CONSTRAINT enforceability behavior
adunstan Jun 27, 2026
02f699c
pgindent fix for commit effb923d9de
adunstan Jun 27, 2026
d6ed87d
Use named boolean parameters for pg_get_*_ddl option arguments
adunstan Jun 26, 2026
b574fec
Avoid collation lookup failure when considering a "char" column.
tglsfdc Jun 28, 2026
e42d4a1
doc: Improve consistency in varlistentry attributes
danielgustafsson Jun 28, 2026
6f4bac8
Hardwire RI fast-path end-of-xact cleanup into xact.c
amitlan Jun 29, 2026
8612f0b
plpython: Fix NULL pointer dereferences for broken sequence and mappi…
Jun 29, 2026
b7e4e3e
doc: Reorder table for Object DDL Functions
michaelpq Jun 29, 2026
994f770
Fix handling of copy_file_range() return value
petere Jun 29, 2026
bc3ae88
Forbid FOR PORTION OF with WHERE CURRENT OF
petere Jun 29, 2026
52e118f
Fix typo
petere Jun 29, 2026
3f815dd
Sync typedefs.list with the buildfarm.
jconway Jun 29, 2026
99e44c3
Run pgperltidy
jconway Jun 29, 2026
9cfd19b
Add previous 2 commits to .git-blame-ignore-revs.
jconway Jun 29, 2026
a281a3e
Stamp HEAD as 20devel.
jconway Jun 29, 2026
efa59a5
Simplify some stats restore code with InputFunctionCallSafe()
michaelpq Jun 29, 2026
8e684ce
Fix unlogged sequence corruption after standby promotion
MasaoFujii Jun 29, 2026
d811309
Remove stray blank line in ParseFuncOrColumn()
MasaoFujii Jun 30, 2026
8d85cb8
bufmgr: Fix race in LockBufferForCleanup()
MasaoFujii Jun 30, 2026
cfa573c
Restore comment at appendShellString().
nmisch Jun 30, 2026
c776550
Change stat_lock.wait_time to double precision
michaelpq Jun 30, 2026
7905416
Use placeholders and not GUC names in error message (autovacuum)
michaelpq Jun 30, 2026
dfe7d17
Refactor pg_stat_get_lock() to use a helper function
michaelpq Jun 30, 2026
8c579bd
Add backend-level lock statistics
michaelpq Jun 30, 2026
cd3ad3b
Fixes for SPI "const Datum *" use
petere Jun 30, 2026
b1c4139
Make SPI_prepare argtypes argument const
petere Jun 30, 2026
ae27a41
Remove pg_spin_delay().
nathan-bossart Jun 30, 2026
2ef57e6
Clean up inconsistencies in CPU-identification macros.
tglsfdc Jun 30, 2026
57f1977
doc: clarify MERGE PARTITIONS adjacency requirement
akorotkov Jun 30, 2026
1de4680
Disallow set-returning functions within window OVER clauses.
tglsfdc Jun 30, 2026
d8312d9
Use fast-hash for Query ID jumbling
lfittl Jun 27, 2026
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
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
#
# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso

99e44c3181c779ae0f3539ba7f408661983fbf8e # 2026-06-29 15:27:44 -0400
# Run pgperltidy

3f815dd11374b54deb29228dc0040179864af828 # 2026-06-29 15:16:25 -0400
# Sync typedefs.list with the buildfarm.

bd57abbb1910e51e45761b59985745d094ae9e03 # 2026-06-04 10:15:37 -0500
# Re-pgindent nodeModifyTable.c after commit 993a7aa0e4.

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 19beta1.
# Generated by GNU Autoconf 2.69 for PostgreSQL 20devel.
#
# 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='19beta1'
PACKAGE_STRING='PostgreSQL 19beta1'
PACKAGE_VERSION='20devel'
PACKAGE_STRING='PostgreSQL 20devel'
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
PACKAGE_URL='https://www.postgresql.org/'

Expand Down Expand Up @@ -1468,7 +1468,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 19beta1 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 20devel to adapt to many kinds of systems.

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

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

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

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

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

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

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20419,7 +20419,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 19beta1
PostgreSQL config.status 20devel
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], [19beta1], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [20devel], [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
13 changes: 6 additions & 7 deletions contrib/dblink/t/001_auth_scram.pl
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,20 @@
{
my $connstr = $node1->connstr($db0) . qq' user=$user';

$node1->safe_psql($db0,
$node1->safe_psql(
$db0,
qq'ALTER USER MAPPING FOR $user SERVER $fdw_server3 OPTIONS(add use_scram_passthrough \'false\')',
connstr => $connstr
);
connstr => $connstr);

my ($ret, $stdout, $stderr) = $node1->psql(
$db0,
"select * from dblink('$fdw_server3', 'select * from t') as t(a int, b int)",
connstr => $connstr);

is($ret, 3, 'SCRAM passthrough disabled on user mapping should fail');
like(
$stderr,
qr/password/i,
'expected password-related error when scram passthrough disabled on user mapping');
like($stderr, qr/password/i,
'expected password-related error when scram passthrough disabled on user mapping'
);
}

# Ensure that trust connections fail without superuser opt-in.
Expand Down
65 changes: 65 additions & 0 deletions contrib/hstore_plpython/expected/hstore_plpython.out
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,71 @@ SELECT test1bad();
ERROR: not a Python mapping
CONTEXT: while creating return value
PL/Python function "test1bad"
-- A mapping whose items() raises should be reported as an error, not crash
-- the backend
CREATE FUNCTION test1broken() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def items(self):
raise ValueError('items failed')
d = C()
d['x'] = 1
return d
$$;
SELECT test1broken();
ERROR: could not get items from Python mapping
CONTEXT: while creating return value
PL/Python function "test1broken"
-- Likewise for a mapping whose items() does not return key/value pairs
CREATE FUNCTION test1malformed() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def items(self):
return [42]
d = C()
d['x'] = 1
return d
$$;
SELECT test1malformed();
ERROR: items() of a Python mapping must return key/value pairs
CONTEXT: while creating return value
PL/Python function "test1malformed"
-- Likewise for a mapping whose items() yields fewer pairs than its length
CREATE FUNCTION test1short() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def items(self):
return []
d = C()
d['x'] = 1
return d
$$;
SELECT test1short();
ERROR: items() of a Python mapping must return key/value pairs
CONTEXT: while creating return value
PL/Python function "test1short"
-- Likewise for a mapping whose __len__() raises
CREATE FUNCTION test1brokenlen() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def __len__(self):
raise ValueError('len failed')
d = C()
d['x'] = 1
return d
$$;
SELECT test1brokenlen();
ERROR: could not get size of Python mapping
CONTEXT: while creating return value
PL/Python function "test1brokenlen"
-- test hstore[] -> python
CREATE FUNCTION test1arr(val hstore[]) RETURNS int
LANGUAGE plpython3u
Expand Down
16 changes: 16 additions & 0 deletions contrib/hstore_plpython/hstore_plpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,16 @@ plpython_to_hstore(PG_FUNCTION_ARGS)
errmsg("not a Python mapping")));

pcount = PyMapping_Size(dict);
if (pcount < 0)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("could not get size of Python mapping")));

items = PyMapping_Items(dict);
if (items == NULL)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("could not get items from Python mapping")));

PG_TRY();
{
Expand All @@ -160,6 +169,13 @@ plpython_to_hstore(PG_FUNCTION_ARGS)
PyObject *value;

tuple = PyList_GetItem(items, i);

/* The mapping's items() must yield key/value pairs */
if (tuple == NULL || !PyTuple_Check(tuple) || PyTuple_Size(tuple) < 2)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("items() of a Python mapping must return key/value pairs")));

key = PyTuple_GetItem(tuple, 0);
value = PyTuple_GetItem(tuple, 1);

Expand Down
65 changes: 65 additions & 0 deletions contrib/hstore_plpython/sql/hstore_plpython.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,71 @@ $$;
SELECT test1bad();


-- A mapping whose items() raises should be reported as an error, not crash
-- the backend
CREATE FUNCTION test1broken() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def items(self):
raise ValueError('items failed')
d = C()
d['x'] = 1
return d
$$;

SELECT test1broken();


-- Likewise for a mapping whose items() does not return key/value pairs
CREATE FUNCTION test1malformed() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def items(self):
return [42]
d = C()
d['x'] = 1
return d
$$;

SELECT test1malformed();


-- Likewise for a mapping whose items() yields fewer pairs than its length
CREATE FUNCTION test1short() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def items(self):
return []
d = C()
d['x'] = 1
return d
$$;

SELECT test1short();


-- Likewise for a mapping whose __len__() raises
CREATE FUNCTION test1brokenlen() RETURNS hstore
LANGUAGE plpython3u
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
def __len__(self):
raise ValueError('len failed')
d = C()
d['x'] = 1
return d
$$;

SELECT test1brokenlen();


-- test hstore[] -> python
CREATE FUNCTION test1arr(val hstore[]) RETURNS int
LANGUAGE plpython3u
Expand Down
89 changes: 89 additions & 0 deletions contrib/jsonb_plpython/expected/jsonb_plpython.out
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,92 @@ SELECT test_dict1();
{"": 2, "a": 1, "33": 3}
(1 row)

-- A custom sequence whose __getitem__ raises should be reported as an error,
-- not crash the backend
CREATE FUNCTION test_broken_sequence() RETURNS jsonb
LANGUAGE plpython3u
TRANSFORM FOR TYPE jsonb
AS $$
class C:
def __len__(self):
return 2
def __getitem__(self, i):
raise ValueError('getitem failed')
return C()
$$;
SELECT test_broken_sequence();
ERROR: could not get element 0 from sequence
DETAIL: ValueError: getitem failed
CONTEXT: Traceback (most recent call last):
while creating return value
PL/Python function "test_broken_sequence"
-- A mapping whose items() raises should be reported as an error, not crash
-- the backend
CREATE FUNCTION test_broken_mapping() RETURNS jsonb
LANGUAGE plpython3u
TRANSFORM FOR TYPE jsonb
AS $$
class C(dict):
def items(self):
raise ValueError('items failed')
d = C()
d['x'] = 1
return d
$$;
SELECT test_broken_mapping();
ERROR: could not get items from Python mapping
DETAIL: ValueError: items failed
CONTEXT: Traceback (most recent call last):
while creating return value
PL/Python function "test_broken_mapping"
-- Likewise for a mapping whose items() does not return key/value pairs
CREATE FUNCTION test_malformed_mapping() RETURNS jsonb
LANGUAGE plpython3u
TRANSFORM FOR TYPE jsonb
AS $$
class C(dict):
def items(self):
return [42]
d = C()
d['x'] = 1
return d
$$;
SELECT test_malformed_mapping();
ERROR: items() of a Python mapping must return key/value pairs
CONTEXT: while creating return value
PL/Python function "test_malformed_mapping"
-- Likewise for a mapping whose items() yields fewer pairs than its length
CREATE FUNCTION test_short_mapping() RETURNS jsonb
LANGUAGE plpython3u
TRANSFORM FOR TYPE jsonb
AS $$
class C(dict):
def items(self):
return []
d = C()
d['x'] = 1
return d
$$;
SELECT test_short_mapping();
ERROR: items() of a Python mapping must return key/value pairs
DETAIL: IndexError: list index out of range
CONTEXT: while creating return value
PL/Python function "test_short_mapping"
-- Likewise for a mapping whose __len__() raises
CREATE FUNCTION test_broken_len_mapping() RETURNS jsonb
LANGUAGE plpython3u
TRANSFORM FOR TYPE jsonb
AS $$
class C(dict):
def __len__(self):
raise ValueError('len failed')
d = C()
d['x'] = 1
return d
$$;
SELECT test_broken_len_mapping();
ERROR: could not get size of Python mapping
DETAIL: ValueError: len failed
CONTEXT: Traceback (most recent call last):
while creating return value
PL/Python function "test_broken_len_mapping"
Loading
Loading