Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
c34787f
Harden nbtree page deletion.
petergeoghegan Feb 4, 2021
82e0e29
Fix YA incremental sort bug.
tglsfdc Feb 5, 2021
e1c02d9
Tab-complete CREATE DATABASE ... LOCALE.
macdice Feb 5, 2021
0ff865f
Fix bug in HashAgg's selective-column-spilling logic.
tglsfdc Feb 5, 2021
5e7fa18
postgres_fdw: Fix assertion in estimate_path_cost_size().
Feb 5, 2021
c444472
Fix backslash-escaping multibyte chars in COPY FROM.
hlinnaka Feb 5, 2021
e955bd4
Move some code from src/bin/scripts to src/fe_utils to permit reuse.
robertmhaas Feb 5, 2021
418611c
Generalize parallel slot result handling.
robertmhaas Feb 5, 2021
f740082
Clarify some comments around SharedRecoveryState in xlog.c
michaelpq Feb 6, 2021
dd705a0
Disallow converting an inheritance child table to a view.
tglsfdc Feb 6, 2021
ed29089
Propagate CTE property flags when copying a CTE list into a rule.
tglsfdc Feb 7, 2021
04fd3ee
Docs: fix pg_wal_lsn_diff manual.
tatsuo-ishii Feb 7, 2021
d1d2979
Revert "Propagate CTE property flags when copying a CTE list into a r…
tglsfdc Feb 7, 2021
617fffe
Rename removable xid function for consistency.
petergeoghegan Feb 7, 2021
6214e2b
Fix permission checks on constraint violation errors on partitions.
hlinnaka Feb 8, 2021
c028faf
Fix mishandling of column-level SELECT privileges for join aliases.
tglsfdc Feb 8, 2021
5fd5900
Correct pgstattuple B-Tree page comments.
petergeoghegan Feb 8, 2021
7cb3048
Add option PROCESS_TOAST to VACUUM
michaelpq Feb 9, 2021
3b733fc
Display the time when the process started waiting for the lock, in pg…
MasaoFujii Feb 9, 2021
890d218
Revert "Display the time when the process started waiting for the loc…
MasaoFujii Feb 9, 2021
31c7fb4
Fix obsolete FSM remarks in nbtree README.
petergeoghegan Feb 9, 2021
cd142e0
Make pg_replication_origin_drop safe against concurrent drops.
Feb 10, 2021
bd12080
Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY
michaelpq Feb 10, 2021
092b785
Simplify code related to compilation of SSL and OpenSSL
michaelpq Feb 10, 2021
4f47260
Fix ORDER BY clause in new regression test of REINDEX CONCURRENTLY
michaelpq Feb 10, 2021
4ad5611
Fix lack of message pluralization
petere Feb 10, 2021
6499008
pg_dump: Add const decorations
petere Feb 10, 2021
e7f4291
Remove extra Success message at the end of initdb
mhagander Feb 10, 2021
69273c8
Add test case for abbrev(cidr)
petere Feb 11, 2021
42d74e0
Fix copy-paste error with SHA256 digest length in checksum_helper.c
michaelpq Feb 11, 2021
d4c7465
Remove no-longer-used RTE argument of markVarForSelectPriv().
tglsfdc Feb 11, 2021
69036aa
Simplify jsonfuncs.c code by using strtoint() not strtol().
tglsfdc Feb 11, 2021
62535ca
Remove dead code in ECPGconnect(), and improve documentation.
tglsfdc Feb 11, 2021
3063eb1
Remove obsolete IndexBulkDeleteResult stats field.
petergeoghegan Feb 12, 2021
ce0fdbf
Allow multiple xacts during table sync in logical replication.
Feb 12, 2021
c8b21b0
Fix Subscription test added by commit ce0fdbfe97.
Feb 12, 2021
993bdb9
pg_attribute_no_sanitize_alignment() macro
akorotkov Feb 12, 2021
ae4867e
Avoid divide-by-zero in regex_selectivity() with long fixed prefix.
tglsfdc Feb 12, 2021
ad2ad69
Tweak compiler version cutoff for no_sanitize("alignment") support.
tglsfdc Feb 12, 2021
8063d0f
doc: Mention NO DEPENDS ON EXTENSION in its supported ALTER commands
michaelpq Feb 13, 2021
8facf1e
README/C-comment: document GiST's NSN value
bmomjian Feb 13, 2021
c7ecd6a
ReadNewTransactionId() -> ReadNextTransactionId().
macdice Feb 15, 2021
2dd6733
Minor fixes to improve regex debugging code.
tglsfdc Feb 15, 2021
b83dcf7
Add result size as argument of pg_cryptohash_final() for overflow checks
michaelpq Feb 15, 2021
637668f
Hold interrupts while running dsm_detach() callbacks.
macdice Feb 15, 2021
d9b0767
Fix the warnings introduced in commit ce0fdbfe97.
Feb 15, 2021
2c8b42b
Use pg_pwrite() in pg_test_fsync.
macdice Feb 15, 2021
f900a79
Default to wal_sync_method=fdatasync on FreeBSD.
macdice Feb 15, 2021
7cde6b1
Adjust lazy_scan_heap() accounting comments.
petergeoghegan Feb 15, 2021
fa41cf8
Avoid misinterpreting GiST pages in pageinspect.
petergeoghegan Feb 15, 2021
9e596b6
Add "LP_DEAD item?" column to GiST pageinspect functions
petergeoghegan Feb 15, 2021
46d6e5f
Display the time when the process started waiting for the lock, in pg…
MasaoFujii Feb 15, 2021
54e51dc
Make ExecGetInsertedCols() and friends more robust and improve comments.
hlinnaka Feb 15, 2021
0e52903
Simplify loop logic in nodeIncrementalSort.c.
tglsfdc Feb 15, 2021
a975ff4
Remove backwards compat ugliness in snapbuild.c.
anarazel Feb 16, 2021
8001cb7
Fix heap_page_prune() parameter order confusion introduced in dc7420c…
anarazel Feb 16, 2021
f672df5
Remove the unnecessary PrepareWrite in pgoutput.
Feb 16, 2021
38bb3ae
Convert tsginidx.c's GIN indexing logic to fully ternary operation.
tglsfdc Feb 16, 2021
e6b8e83
Add psql completion for [ NO ] DEPENDS ON EXTENSION
michaelpq Feb 17, 2021
0e392fc
Use errmsg_internal for debug messages
petere Feb 17, 2021
a29f307
Fix typo
mhagander Feb 17, 2021
f40c696
Routine usage information schema tables
petere Feb 17, 2021
4e703d6
Make some minor improvements in the regex code.
tglsfdc Feb 17, 2021
c15283f
Fix pointer type in ExecForeignBatchInsert SGML docs
tvondra Feb 17, 2021
927f453
Fix tuple routing to initialize batching only for inserts
tvondra Feb 17, 2021
128dd90
nbtree README: move VACUUM linear scan section.
petergeoghegan Feb 18, 2021
f5465fa
Allow specifying CRL directory
petere Feb 18, 2021
eb42110
Add tests for bytea LIKE operator
petere Feb 18, 2021
614b7f1
Fix "invalid spinlock number: 0" error in pg_stat_wal_receiver.
MasaoFujii Feb 18, 2021
b5a66e7
Fix another ancient bug in parsing of BRE-mode regular expressions.
tglsfdc Feb 19, 2021
b071a31
Add nbtree README section on page recycling.
petergeoghegan Feb 19, 2021
678d0e2
Update snowball
petere Feb 19, 2021
8a55cb5
Fix bug in COMMIT AND CHAIN command.
MasaoFujii Feb 19, 2021
fe06819
Fix psql's ON_ERROR_ROLLBACK so that it handles COMMIT AND CHAIN.
MasaoFujii Feb 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions contrib/amcheck/expected/check_btree.out
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ SELECT bt_index_parent_check('bttest_b_idx');
SELECT * FROM pg_locks
WHERE relation = ANY(ARRAY['bttest_a', 'bttest_a_idx', 'bttest_b', 'bttest_b_idx']::regclass[])
AND pid = pg_backend_pid();
locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted | fastpath
----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-----+------+---------+----------
locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted | fastpath | waitstart
----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-----+------+---------+----------+-----------
(0 rows)

COMMIT;
Expand Down
12 changes: 6 additions & 6 deletions contrib/amcheck/verify_nbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
if (metad->btm_fastroot != metad->btm_root)
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg("harmless fast root mismatch in index %s",
errmsg_internal("harmless fast root mismatch in index %s",
RelationGetRelationName(rel)),
errdetail_internal("Fast root block %u (level %u) differs from true root block %u (level %u).",
metad->btm_fastroot, metad->btm_fastlevel,
Expand Down Expand Up @@ -721,7 +721,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
else
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg("block %u of index \"%s\" ignored",
errmsg_internal("block %u of index \"%s\" ignored",
current, RelationGetRelationName(state->rel))));
goto nextpage;
}
Expand Down Expand Up @@ -979,7 +979,7 @@ bt_recheck_sibling_links(BtreeCheckState *state,
/* Report split in left sibling, not target (or new target) */
ereport(DEBUG1,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("harmless concurrent page split detected in index \"%s\"",
errmsg_internal("harmless concurrent page split detected in index \"%s\"",
RelationGetRelationName(state->rel)),
errdetail_internal("Block=%u new right sibling=%u original right sibling=%u.",
leftcurrent, newtargetblock,
Expand Down Expand Up @@ -1605,7 +1605,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
targetnext = opaque->btpo_next;
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg("level %u leftmost page of index \"%s\" was found deleted or half dead",
errmsg_internal("level %u leftmost page of index \"%s\" was found deleted or half dead",
opaque->btpo.level, RelationGetRelationName(state->rel)),
errdetail_internal("Deleted page found when building scankey from right sibling.")));

Expand Down Expand Up @@ -1733,7 +1733,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
*/
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg("%s block %u of index \"%s\" has no first data item",
errmsg_internal("%s block %u of index \"%s\" has no first data item",
P_ISLEAF(opaque) ? "leaf" : "internal", targetnext,
RelationGetRelationName(state->rel))));
return NULL;
Expand Down Expand Up @@ -2287,7 +2287,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
{
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg("harmless interrupted page split detected in index %s",
errmsg_internal("harmless interrupted page split detected in index %s",
RelationGetRelationName(state->rel)),
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
blkno, opaque->btpo.level,
Expand Down
32 changes: 16 additions & 16 deletions contrib/pageinspect/expected/gist.out
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 2));

COMMIT;
SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gist_idx');
itemoffset | ctid | itemlen | keys
------------+-----------+---------+-------------------
1 | (1,65535) | 40 | (p)=((166,166))
2 | (2,65535) | 40 | (p)=((332,332))
3 | (3,65535) | 40 | (p)=((498,498))
4 | (4,65535) | 40 | (p)=((664,664))
5 | (5,65535) | 40 | (p)=((830,830))
6 | (6,65535) | 40 | (p)=((996,996))
7 | (7,65535) | 40 | (p)=((1000,1000))
itemoffset | ctid | itemlen | dead | keys
------------+-----------+---------+------+-------------------
1 | (1,65535) | 40 | f | (p)=((166,166))
2 | (2,65535) | 40 | f | (p)=((332,332))
3 | (3,65535) | 40 | f | (p)=((498,498))
4 | (4,65535) | 40 | f | (p)=((664,664))
5 | (5,65535) | 40 | f | (p)=((830,830))
6 | (6,65535) | 40 | f | (p)=((996,996))
7 | (7,65535) | 40 | f | (p)=((1000,1000))
(7 rows)

SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 1), 'test_gist_idx') LIMIT 5;
itemoffset | ctid | itemlen | keys
------------+-------+---------+-------------
1 | (0,1) | 40 | (p)=((1,1))
2 | (0,2) | 40 | (p)=((2,2))
3 | (0,3) | 40 | (p)=((3,3))
4 | (0,4) | 40 | (p)=((4,4))
5 | (0,5) | 40 | (p)=((5,5))
itemoffset | ctid | itemlen | dead | keys
------------+-------+---------+------+-------------
1 | (0,1) | 40 | f | (p)=((1,1))
2 | (0,2) | 40 | f | (p)=((2,2))
3 | (0,3) | 40 | f | (p)=((3,3))
4 | (0,4) | 40 | f | (p)=((4,4))
5 | (0,5) | 40 | f | (p)=((5,5))
(5 rows)

-- gist_page_items_bytea prints the raw key data as a bytea. The output of that is
Expand Down
30 changes: 20 additions & 10 deletions contrib/pageinspect/gistfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
MemoryContext oldcontext;
Page page;
OffsetNumber offset;
OffsetNumber maxoff = InvalidOffsetNumber;

if (!superuser())
ereport(ERROR,
Expand Down Expand Up @@ -135,15 +136,18 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)

page = get_page_from_raw(raw_page);

/* Avoid bogus PageGetMaxOffsetNumber() call with deleted pages */
if (GistPageIsDeleted(page))
elog(NOTICE, "page is deleted");
else
maxoff = PageGetMaxOffsetNumber(page);

for (offset = FirstOffsetNumber;
offset <= PageGetMaxOffsetNumber(page);
offset <= maxoff;
offset++)
{
Datum values[4];
bool nulls[4];
Datum values[5];
bool nulls[5];
ItemId id;
IndexTuple itup;
bytea *tuple_bytea;
Expand All @@ -166,7 +170,8 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
tuple_bytea = (bytea *) palloc(tuple_len + VARHDRSZ);
SET_VARSIZE(tuple_bytea, tuple_len + VARHDRSZ);
memcpy(VARDATA(tuple_bytea), itup, tuple_len);
values[3] = PointerGetDatum(tuple_bytea);
values[3] = BoolGetDatum(ItemIdIsDead(id));
values[4] = PointerGetDatum(tuple_bytea);

tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
Expand All @@ -187,6 +192,7 @@ gist_page_items(PG_FUNCTION_ARGS)
MemoryContext oldcontext;
Page page;
OffsetNumber offset;
OffsetNumber maxoff = InvalidOffsetNumber;

if (!superuser())
ereport(ERROR,
Expand Down Expand Up @@ -222,15 +228,18 @@ gist_page_items(PG_FUNCTION_ARGS)

page = get_page_from_raw(raw_page);

/* Avoid bogus PageGetMaxOffsetNumber() call with deleted pages */
if (GistPageIsDeleted(page))
elog(NOTICE, "page is deleted");
else
maxoff = PageGetMaxOffsetNumber(page);

for (offset = FirstOffsetNumber;
offset <= PageGetMaxOffsetNumber(page);
offset <= maxoff;
offset++)
{
Datum values[4];
bool nulls[4];
Datum values[5];
bool nulls[5];
ItemId id;
IndexTuple itup;
Datum itup_values[INDEX_MAX_KEYS];
Expand All @@ -252,14 +261,15 @@ gist_page_items(PG_FUNCTION_ARGS)
values[0] = DatumGetInt16(offset);
values[1] = ItemPointerGetDatum(&itup->t_tid);
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
values[3] = BoolGetDatum(ItemIdIsDead(id));

key_desc = BuildIndexValueDescription(indexRel, itup_values, itup_isnull);
if (key_desc)
values[3] = CStringGetTextDatum(key_desc);
values[4] = CStringGetTextDatum(key_desc);
else
{
values[3] = (Datum) 0;
nulls[3] = true;
values[4] = (Datum) 0;
nulls[4] = true;
}

tuplestore_putvalues(tupstore, tupdesc, values, nulls);
Expand Down
2 changes: 2 additions & 0 deletions contrib/pageinspect/pageinspect--1.8--1.9.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CREATE FUNCTION gist_page_items_bytea(IN page bytea,
OUT itemoffset smallint,
OUT ctid tid,
OUT itemlen smallint,
OUT dead boolean,
OUT key_data bytea)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'gist_page_items_bytea'
Expand All @@ -35,6 +36,7 @@ CREATE FUNCTION gist_page_items(IN page bytea,
OUT itemoffset smallint,
OUT ctid tid,
OUT itemlen smallint,
OUT dead boolean,
OUT keys text)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'gist_page_items'
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_prewarm/autoprewarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
apw_state->pid_using_dumpfile = InvalidPid;

ereport(DEBUG1,
(errmsg("wrote block details for %d blocks", num_blocks)));
(errmsg_internal("wrote block details for %d blocks", num_blocks)));
return num_blocks;
}

Expand Down
2 changes: 1 addition & 1 deletion contrib/pgcrypto/internal-sha2.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int_sha2_finish(PX_MD *h, uint8 *dst)
{
pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr;

if (pg_cryptohash_final(ctx, dst) < 0)
if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0)
elog(ERROR, "could not finalize %s context", "SHA2");
}

Expand Down
4 changes: 2 additions & 2 deletions contrib/pgcrypto/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int_md5_finish(PX_MD *h, uint8 *dst)
{
pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr;

if (pg_cryptohash_final(ctx, dst) < 0)
if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0)
elog(ERROR, "could not finalize %s context", "MD5");
}

Expand Down Expand Up @@ -156,7 +156,7 @@ int_sha1_finish(PX_MD *h, uint8 *dst)
{
pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr;

if (pg_cryptohash_final(ctx, dst) < 0)
if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0)
elog(ERROR, "could not finalize %s context", "SHA1");
}

Expand Down
4 changes: 2 additions & 2 deletions contrib/pgstattuple/pgstattuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
if (P_IGNORE(opaque))
{
/* recyclable page */
/* deleted or half-dead page */
stat->free_space += BLCKSZ;
}
else if (P_ISLEAF(opaque))
Expand All @@ -440,7 +440,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,
}
else
{
/* root or node */
/* internal page */
}
}

Expand Down
43 changes: 41 additions & 2 deletions contrib/postgres_fdw/expected/postgres_fdw.out
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,24 @@ SELECT t1."C 1", t2.c1, t3.c1 FROM "S 1"."T 1" t1 full join ft1 t2 full join ft2

RESET enable_hashjoin;
RESET enable_nestloop;
-- Test executing assertion in estimate_path_cost_size() that makes sure that
-- retrieved_rows for foreign rel re-used to cost pre-sorted foreign paths is
-- a sensible value even when the rel has tuples=0
CREATE TABLE loct_empty (c1 int NOT NULL, c2 text);
CREATE FOREIGN TABLE ft_empty (c1 int NOT NULL, c2 text)
SERVER loopback OPTIONS (table_name 'loct_empty');
INSERT INTO loct_empty
SELECT id, 'AAA' || to_char(id, 'FM000') FROM generate_series(1, 100) id;
DELETE FROM loct_empty;
ANALYZE ft_empty;
EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft_empty ORDER BY c1;
QUERY PLAN
-------------------------------------------------------------------------------
Foreign Scan on public.ft_empty
Output: c1, c2
Remote SQL: SELECT c1, c2 FROM public.loct_empty ORDER BY c1 ASC NULLS LAST
(3 rows)

-- ===================================================================
-- WHERE with remotely-executable conditions
-- ===================================================================
Expand Down Expand Up @@ -8928,7 +8946,7 @@ DO $d$
END;
$d$;
ERROR: invalid option "password"
HINT: Valid options in this context are: service, passfile, channel_binding, connect_timeout, dbname, host, hostaddr, port, options, application_name, keepalives, keepalives_idle, keepalives_interval, keepalives_count, tcp_user_timeout, sslmode, sslcompression, sslcert, sslkey, sslrootcert, sslcrl, requirepeer, ssl_min_protocol_version, ssl_max_protocol_version, gssencmode, krbsrvname, gsslib, target_session_attrs, use_remote_estimate, fdw_startup_cost, fdw_tuple_cost, extensions, updatable, fetch_size, batch_size
HINT: Valid options in this context are: service, passfile, channel_binding, connect_timeout, dbname, host, hostaddr, port, options, application_name, keepalives, keepalives_idle, keepalives_interval, keepalives_count, tcp_user_timeout, sslmode, sslcompression, sslcert, sslkey, sslrootcert, sslcrl, sslcrldir, requirepeer, ssl_min_protocol_version, ssl_max_protocol_version, gssencmode, krbsrvname, gsslib, target_session_attrs, use_remote_estimate, fdw_startup_cost, fdw_tuple_cost, extensions, updatable, fetch_size, batch_size
CONTEXT: SQL statement "ALTER SERVER loopback_nopw OPTIONS (ADD password 'dummypw')"
PL/pgSQL function inline_code_block line 3 at EXECUTE
-- If we add a password for our user mapping instead, we should get a different
Expand Down Expand Up @@ -9396,5 +9414,26 @@ SELECT COUNT(*) FROM batch_table;
66
(1 row)

-- Check that enabling batched inserts doesn't interfere with cross-partition
-- updates
CREATE TABLE batch_cp_upd_test (a int) PARTITION BY LIST (a);
CREATE TABLE batch_cp_upd_test1 (LIKE batch_cp_upd_test);
CREATE FOREIGN TABLE batch_cp_upd_test1_f
PARTITION OF batch_cp_upd_test
FOR VALUES IN (1)
SERVER loopback
OPTIONS (table_name 'batch_cp_upd_test1', batch_size '10');
CREATE TABLE batch_cp_up_test1 PARTITION OF batch_cp_upd_test
FOR VALUES IN (2);
INSERT INTO batch_cp_upd_test VALUES (1), (2);
-- The following moves a row from the local partition to the foreign one
UPDATE batch_cp_upd_test t SET a = 1 FROM (VALUES (1), (2)) s(a) WHERE t.a = s.a;
SELECT tableoid::regclass, * FROM batch_cp_upd_test;
tableoid | a
----------------------+---
batch_cp_upd_test1_f | 1
batch_cp_upd_test1_f | 1
(2 rows)

-- Clean up
DROP TABLE batch_table CASCADE;
DROP TABLE batch_table, batch_cp_upd_test CASCADE;
Loading