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

Merging community commit - d746021de18baf0f29eff0388204a0664f41eb8b Add construct_array_builtin, deconstruct_array_builtin #52

Closed
wants to merge 1 commit into from

Conversation

ahmed-shameem
Copy link

@ahmed-shameem ahmed-shameem commented Nov 28, 2023

Merging community commit - d746021de18baf0f29eff0388204a0664f41eb8b Add construct_array_builtin, deconstruct_array_builtin

Merge conflict (found only in src/backend/parser/parse_type.c):
pg16_merge_conflict.txt

--> src/backend/parser/parse_type.c
<<<<<<< HEAD
	/*
	 * Checks whether variable length datatypes like numeric, decimal, time, datetime2, datetimeoffset
	 * are declared with permissible datalength at the time of table or stored procedure creation
	 */
	if (validate_var_datatype_scale_hook)
			(*validate_var_datatype_scale_hook)(typeName, typ);

	/* hardwired knowledge about cstring's representation details here */
	arrtypmod = construct_array(datums, n, CSTRINGOID,
								-2, false, TYPALIGN_CHAR);
=======
	arrtypmod = construct_array_builtin(datums, n, CSTRINGOID);
>>>>>>> d746021de1 (Add construct_array_builtin, deconstruct_array_builtin)

Extension side PR: amazon-aurora/babelfish_extensions#54

There were many calls to construct_array() and deconstruct_array() for
built-in types, for example, when dealing with system catalog columns.
These all hardcoded the type attributes necessary to pass to these
functions.

To simplify this a bit, add construct_array_builtin(),
deconstruct_array_builtin() as wrappers that centralize this hardcoded
knowledge.  This simplifies many call sites and reduces the amount of
hardcoded stuff that is spread around.

Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/2914356f-9e5f-8c59-2995-5997fc48bcba%40enterprisedb.com
@ahmed-shameem ahmed-shameem deleted the pg16-cherry-pick-bff-1 branch November 28, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants