postgresql/src/test/regress/sql
Alexander Korotkov fcf80c5d5f Make new partitions with parent's persistence during MERGE/SPLIT
The createPartitionTable() function is responsible for creating new partitions
for ALTER TABLE ... MERGE PARTITIONS, and ALTER TABLE ... SPLIT PARTITION
commands.  It emulates the behaviour of CREATE TABLE ... (LIKE ...), where
new table persistence should be specified by the user.  In the table
partitioning persistent of the partition and its parent must match.  So, this
commit makes createPartitionTable() copy the persistence of the parent
partition.

Also, this commit makes createPartitionTable() recheck the persistence after
the new table creation.  This is needed because persistence might be affected
by pg_temp in search_path.

This commit also changes the signature of createPartitionTable() making it
take the parent's Relation itself instead of the name of the parent relation,
and return the Relation of new partition.  That doesn't lead to
complications, because both callers have the parent table open and need to
open the new partition.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/dbc8b96c-3cf0-d1ee-860d-0e491da20485%40gmail.com
Author: Dmitry Koval
Reviewed-by: Alexander Korotkov, Robert Haas, Justin Pryzby, Pavel Borisov
2024-04-30 12:00:15 +03:00
..
advisory_lock.sql
aggregates.sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
alter_generic.sql
alter_operator.sql
alter_table.sql
amutils.sql
arrays.sql
async.sql
bit.sql
bitmapops.sql
boolean.sql
box.sql
brin_bloom.sql
brin_multi.sql
brin.sql Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
btree_index.sql
case.sql
char.sql
circle.sql
cluster.sql
collate.icu.utf8.sql
collate.linux.utf8.sql
collate.sql
collate.utf8.sql
collate.windows.win1252.sql
combocid.sql
comments.sql
compression.sql
constraints.sql Better handle indirect constraint drops 2024-04-19 12:37:33 +02:00
conversion.sql
copy2.sql
copy.sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
copydml.sql
copyselect.sql
create_aggregate.sql
create_am.sql
create_cast.sql
create_function_c.sql
create_function_sql.sql
create_index_spgist.sql
create_index.sql
create_misc.sql
create_operator.sql
create_procedure.sql
create_role.sql
create_schema.sql
create_table_like.sql
create_table.sql
create_type.sql
create_view.sql
date.sql
dbsize.sql
delete.sql
dependency.sql
domain.sql Fix ALTER DOMAIN NOT NULL syntax 2024-04-15 08:34:45 +02:00
drop_if_exists.sql
drop_operator.sql
enum.sql
equivclass.sql
errors.sql
event_trigger_login.sql
event_trigger.sql
explain.sql
expressions.sql
fast_default.sql
float4.sql
float8.sql
foreign_data.sql
foreign_key.sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
functional_deps.sql
generated.sql
geometry.sql
gin.sql
gist.sql
groupingsets.sql
guc.sql
hash_func.sql
hash_index.sql
hash_part.sql
horology.sql Detect more overflows in timestamp[tz]_pl_interval. 2024-04-28 13:42:13 -04:00
identity.sql
incremental_sort.sql
index_including_gist.sql
index_including.sql
indexing.sql
indirect_toast.sql
inet.sql
infinite_recurse.sql
inherit.sql Fix propagating attnotnull in multiple inheritance 2024-04-15 12:20:56 +02:00
init_privs.sql
insert_conflict.sql
insert.sql
int2.sql
int4.sql
int8.sql
interval.sql
join_hash.sql
join.sql
json_encoding.sql
json.sql
jsonb_jsonpath.sql
jsonb.sql
jsonpath_encoding.sql
jsonpath.sql
largeobject.sql
limit.sql
line.sql
lock.sql
lseg.sql
macaddr8.sql
macaddr.sql
matview.sql
md5.sql
memoize.sql
merge.sql
misc_functions.sql
misc_sanity.sql
misc.sql
money.sql
multirangetypes.sql
mvcc.sql
name.sql
namespace.sql
numeric_big.sql
numeric.sql
numerology.sql
object_address.sql
oid.sql
oidjoins.sql
opr_sanity.sql
partition_aggregate.sql
partition_info.sql
partition_join.sql
partition_merge.sql Make new partitions with parent's persistence during MERGE/SPLIT 2024-04-30 12:00:15 +03:00
partition_prune.sql
partition_split.sql Make new partitions with parent's persistence during MERGE/SPLIT 2024-04-30 12:00:15 +03:00
password.sql
path.sql
pg_lsn.sql
plancache.sql
plpgsql.sql
point.sql
polygon.sql
polymorphism.sql
portals_p2.sql
portals.sql
predicate.sql Fix IS [NOT] NULL qual optimization for inheritance tables 2024-04-12 20:07:53 +12:00
prepare.sql
prepared_xacts.sql Make two-phase tests of ECPG and main suite more concurrent-proof 2024-04-29 21:10:41 +09:00
privileges.sql
psql_crosstab.sql
psql.sql
publication.sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
random.sql
rangefuncs.sql Fix type-checking of RECORD-returning functions in FROM, redux. 2024-04-15 12:56:56 -04:00
rangetypes.sql
regex.sql
regproc.sql
reindex_catalog.sql
reloptions.sql
replica_identity.sql
returning.sql
roleattributes.sql
rowsecurity.sql
rowtypes.sql
rules.sql
sanity_check.sql
security_label.sql
select_distinct_on.sql
select_distinct.sql
select_having.sql
select_implicit.sql
select_into.sql
select_parallel.sql
select_views.sql
select.sql
sequence.sql
spgist.sql
sqljson_jsontable.sql SQL/JSON: Fix issues with DEFAULT .. ON ERROR / EMPTY 2024-04-18 14:46:35 +09:00
sqljson_queryfuncs.sql Fix object name clash in recently introduced test 2024-04-18 17:28:12 +09:00
sqljson.sql
stats_ext.sql
stats.sql
strings.sql
subscription.sql Fix the handling of the failover option in subscription commands. 2024-04-23 12:22:30 +05:30
subselect.sql
sysviews.sql Improve test coverage in bump.c 2024-04-16 16:21:31 +12:00
tablesample.sql
tablespace.sql
temp.sql
test_setup.sql
text.sql
tid.sql
tidrangescan.sql
tidscan.sql
time.sql
timestamp.sql
timestamptz.sql
timetz.sql
transactions.sql
triggers.sql
truncate.sql
tsdicts.sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
tsearch.sql
tsrf.sql
tstypes.sql
tuplesort.sql Improve test coverage in bump.c 2024-04-16 16:21:31 +12:00
txid.sql
type_sanity.sql
typed_table.sql
unicode.sql
union.sql
updatable_views.sql
update.sql
uuid.sql
vacuum_parallel.sql
vacuum.sql
varchar.sql
window.sql
with.sql
without_overlaps.sql
write_parallel.sql
xid.sql
xml.sql
xmlmap.sql