Commit Graph

2537 Commits (b760ec769c265e6a1392ddaa5fbd46e69a45c850)

Author SHA1 Message Date
Sait Talha Nisanci b760ec769c fixup! Introduces CopyFromState_compat macro 2021-08-27 00:04:05 +03:00
Sait Talha Nisanci 1ed8c1d4e5 fixup! Introduces ExecSimpleRelationInsert_compat and modifyStateResultRelInfo macros 2021-08-27 00:01:04 +03:00
Sait Talha Nisanci 32c2d138fc fixup! Adds AlterTableStmtObjType macro 2021-08-26 23:59:42 +03:00
Sait Talha Nisanci 95aae43a9c fixup! Introduces ProcessUtility macros for readOnlyTree parameter 2021-08-26 23:50:42 +03:00
Sait Talha Nisanci dfcc7932a0 fixup! Introduces getObjectTypeDescription_compat and getObjectIdentity_compat macros 2021-08-26 23:49:11 +03:00
Sait Talha Nisanci db87eab790 fixup! Introduces macros for vacuum options 2021-08-26 23:46:43 +03:00
Sait Talha Nisanci 03128ac7ec fixup! Introduces macros for functions that now have include_out_arguments argument 2021-08-26 23:44:23 +03:00
Sait Talha Nisanci 7a55aa18f2 fixup! Introduces STATUS_WAITING_COMPAT macro 2021-08-26 23:42:48 +03:00
Sait Talha Nisanci d7ca503b40 fixup! Introduces ROLE_MONITOR_COMPAT macro 2021-08-26 23:40:54 +03:00
Sait Talha Nisanci e5b214d15c fixup! Introduces F_NEXTVAL_COMPAT macro 2021-08-26 23:39:01 +03:00
Sait Talha Nisanci 6d16d092c2 CHANGELOG: Allow REINDEX to change the tablespace of the new index 2021-08-26 16:23:42 +03:00
Sait Talha Nisanci 23131a52cd Fix style 2021-08-25 17:17:16 +03:00
Sait Talha Nisanci b6bd3c2d81 fix array_cat_agg for pg upgrades
array_cat_agg now needs to take anycompatiblearray instead of anyarray
because array_cat changed its type from anyarray to anycompatiblearray
with pg14.

To handle upgrades correctly, we drop the aggregate in
citus_pg_prepare_upgrade. To be able to drop it, we first remove the
dependency from pg_depend.

Then we create the right aggregate in citus_finish_pg_upgrade and we
also add the dependency back to pg_depend.
2021-08-25 16:25:21 +03:00
Sait Talha Nisanci 3b92284a9a Get partition column via updatedCols 2021-08-25 16:25:20 +03:00
Sait Talha Nisanci f46b7fe70e Disable queryId calculation in our test suite
With pg_stat_statements queryId is calculated by default now but that
puts an extra line to explain outputs with Query Identifier. To avoid
that, we explicitly turn off this setting.

Commit on PG:
cafde58b337e007cb6a719f5ab4dd6459d932a39
2021-08-25 16:24:43 +03:00
Sait Talha Nisanci 327adfc53f Rewrite AppendColumnNames for Pg14
Postgres changed stats expression types as of PG14. Hence we needed to
write the AppendColumnNames method. Also they removed the error on PG
side so we remove it as well.

Relevant commits on pg14:
a4d75c86bf15220df22de0a92c819ecef9db3849
388e75ad33489b77cfb9a8590a91e9287d8fb960
2021-08-25 16:24:43 +03:00
Sait Talha Nisanci 52b249ff13 Reset queryId to 0 for Explain queries
When queryId is not 0 and verbose is true, the query identifier is
emitted to the explain output. This is breaking Postgres outputs.
There might be a reason we process postgres tables for explain but
ideally if the explain doesn't contain any citus table, we should just
let Postgres handle it.

Commit on PG that introduced the query identifier in the explain output:
4f0b0966c866ae9f0e15d7cc73ccf7ce4e1af84b
2021-08-25 16:24:43 +03:00
Halil Ozan Akgul 0305e0bbb2 Readds deleted resultRelInfo changes for previos PG versions
These changes were removed in commit: Introduces ExecSimpleRelationInsert_compat and modifyStateResultRelInfo macros
We shouldn't have removed them but instead kept them for before PG14
2021-08-25 16:23:40 +03:00
Halil Ozan Akgul a98f336aea Puts usage of HASH_STRINGS in PG14 version check 2021-08-25 16:20:19 +03:00
Halil Ozan Akgul dd7d787365 Introduces pg_get_statisticsobj_worker_compat macro
Relevant PG commit:
a4d75c86bf15220df22de0a92c819ecef9db3849
2021-08-25 16:20:19 +03:00
Halil Ozan Akgul 1a87aa4dd1 Introduces make_simple_restrictinfo_compat and pull_varnos_compat macros
make_simple_restrictinfo and pull_varnos functions now have a new parameter
These new macros give us the ability to use this new parameter for PG14 and they don't give the parameter for previous versions

Relevant PG commit:
55dc86eca70b1dc18a79c141b3567efed910329d
2021-08-25 16:20:19 +03:00
Sait Talha Nisanci a76aec21f4 Add shard relation to pState in localCopy
CopyFrom expects an AccessShareLock on the table. Instead of adding an
explicit lock, we do it how postgres is doing, which is to use
addRangeTableEntryForRelation.

Commit:
c532d15dddff14b01fe9ef1d465013cb8ef186df
2021-08-25 16:18:32 +03:00
Sait Talha Nisanci 84b1f74939 Use rte->updatedCols to determine if partition column exists
Use rte->updatedCols to determine if partition column exists in the
target list in case of UPDATE.

Commit on PG:
86dc90056dfdbd9d1b891718d2e5614e3e432f35
2021-08-25 16:18:32 +03:00
Sait Talha Nisanci 9d73845580 Use oid_hash in write state management 2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 6391810632 Changes array_cat argument type from anyarray to anycompatiblearray
Relevant PG commit:
9e38c2bb5093ceb0c04d6315ccd8975bd17add66
2021-08-25 16:18:32 +03:00
Sait Talha Nisanci f287472150 Fix unlimited copy size variable's value 2021-08-25 16:18:32 +03:00
Sait Talha Nisanci 1520b1900a Use empty string instead of NULL for queryString
Postgres doesn't accept NULL for queryStrings in explain plans anymore.
Internally, there are some places in Postgres where they modified the
NULLS to ""(the empty string). So we do the same on citus side.

Commit on Postgres:
1111b2668d89bfcb6f502789158b1233ab4217a6
2021-08-25 16:18:32 +03:00
Sait Talha Nisanci 8d6c5d1fb9 Use HASH_STRINGS explicitly in hash functions
Postgres expects to set the HASH_STRINGS explicitly in case of the
default behaivor for string hash function.

Postgres Commit
b3817f5f774663d55931dd4fab9c5a94a15ae7ab
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul c18ab06965 Renames shadowing ruleutils_14.c variables 2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 4dd455e7fe Introduces index_insert_compat macro
index_insert function now has a new parameter, indexUnchanged
This new macro give us the ability to use these new parameter for PG14 and they don't give the parameters for previous versions
Existing parameter is set to false

Relevant PG commit:
9dc718bdf2b1a574481a45624d42b674332e2903
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 9a1f793000 Introduces ExecSimpleRelationInsert_compat and modifyStateResultRelInfo macros
es_result_relation_info is removed from Estate. In this commit we make some changes to handle that.
resultRelationInfo filed is added to ModifyState to support the removed field.

Relevant PG commits:
1375422c7826a2bf387be29895e961614f69de4b
a04daa97a4339c38e304cd6164d37da540d665a8
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul ade73a733e Introduces GetOldestNonRemovableTransactionId_compat macro
GetOldestXmin function is removed so we use GetOldestNonRemovableTransactionId functions instead
GetOldestNonRemovableTransactionId_compat picks the appropriate one

Relevant PG commit:
dc7420c2c9274a283779ec19718d2d16323640c0
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 4b377c3fec Introduces get_partition_parent_compat and RelationGetPartitionDesc_compat macros
get_partition_parent and RelationGetPartitionDesc functions now have new parameters to also include detached partitions
Thess new macros give us the ability to use these new parameter for PG14 and they don't give the parameters for previous versions
Existing parameters are set to not accept detached partitions

Relevant PG commit:
71f4c8c6f74ba021e55d35b1128d22fb8c6e1629
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul d8f2796617 Introduces proc_statusflags_compat macro
In two commits vacuumFlags in PGXACT is moved and then renamed to status flags
This macro uses the appropriate version of the flag

Relevant PG commits:
5788e258bb26495fab65ff3aa486268d1c50b123
cd9c1b3e197a9b53b840dcc87eb41b04d601a5f9
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 4469fb2eee Introduces SetTuplestoreDestReceiverParams_compat macro
SetTuplestoreDestReceiverParams function now has two new parameters
This new macro give us the ability to use this new parameter for PG14 and it doesn't give the parameter for previous versions
Existing parameters are set to NULL to keep previous behavior

Relevant PG commit:
2f48ede080f42b97b594fb14102c82ca1001b80c
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 7c606837ab !!!!! DO NOT MERGE THIS COMMIT 2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 23c68e8ef3 Uses lfirst_node in ruleutils_14.c
Relevant PG commit:
2b00db4fb0c7f02f000276bfadaab65a14059168
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul ec3a4d2312 Adds missing include_out_argument parameter to func_get_detail in ruleutils_14.c
Relevant PG commit:
e56bce5d43789cce95d099554ae9593ada92b3b7
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 7ed9597684 Adds SQL-standard function body support to ruleutils_14.c
Relevant PG commit:
e717a9a18b2e34c9c40e5259ad4d31cd7e420750
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 9a9396ae21 Adds EXTRACT cases to get_func_sql_syntax in ruleutils_14.c
Relevant PG commit:
a2da77cdb4661826482ebf2ddba1f953bc74afe4
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 0476f52a0a Removes ModifyTable check from set_deparse_plan in ruleutils_14.c
Relevant PG commit:
86dc90056dfdbd9d1b891718d2e5614e3e432f35
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 7d8534537a Adds JOIN ... USING alias to ruleutils_14.c
Relevant PG commit:
055fee7eb4dcc78e58672aef146334275e1cc40d
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 2244738e0e Extends statistics on expressions in ruleutils_14.c
Relevant PG commit:
a4d75c86bf15220df22de0a92c819ecef9db3849
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 64c1e339f9 Adds GROUP BY DISTINCT to ruleutils_14.c
Relevant PG commit:
be45be9c33a85e72cdaeb9967e9f6d2d00199e09
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 9fdd06c2d6 Enhances cycle mark values at ruleutils_14.c
Relevant PG commit:
f4adc41c4f92cc91d507b19e397140c35bb9fd71
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 17f0afd883 Adds SEARCH and CYCLE clauses to ruleutils_14.c
Relevant PG commit:
3696a600e2292d43c00949ddf0352e4ebb487e5b
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul facab93ad2 Adds bytea equivalents of ltrim() and rtrim() to ruleutils_14.c
Relevant PG commit:
a6cf3df4ebdcbc7857910a67f259705645383e9f
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 4e38b0cbb8 Adds HASH_STRINGS flag to ruleutils_14.c
Relevant PG commit:
b3817f5f774663d55931dd4fab9c5a94a15ae7ab
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 8a994bb12c Removes dependency.h from ruleutils_14.c
Relevant PG commit:
8b069ef5dca97cd737a5fd64c420df3cd61ec1c9
2021-08-25 16:18:32 +03:00
Halil Ozan Akgul 2f02e775a5 Removes indexing.h header from ruleutils_14.c
Relevant PG commit:
bdc4edbea6fc847f806e1e7118d730e159512bfc
2021-08-25 16:18:32 +03:00