Handling correct typmod for money/smallmoney during coercion and dump-restore#586
Merged
jsudrik merged 1 commit intoJun 6, 2025
Conversation
…-restore (babelfish-for-postgresql#575) This PR handles the dump/restore case for smallmoney/money and handles typmod for these dataype while coercing to domain. Signed-off-by: Tanya Gupta tanyagp@amazon.com Extension PR : babelfish-for-postgresql/babelfish_extensions#3719 Issues Resolved BABEL-5512
rohit01010
approved these changes
Jun 6, 2025
jsudrik
approved these changes
Jun 6, 2025
jsudrik
left a comment
There was a problem hiding this comment.
Approved. Cherrypick from the other branch.
jsudrik
merged commit Jun 6, 2025
45fb228
into
babelfish-for-postgresql:BABEL_4_X_DEV__PG_16_X
2 checks passed
jsudrik
pushed a commit
to babelfish-for-postgresql/babelfish_extensions
that referenced
this pull request
Jun 6, 2025
…her branch is of smallmoney/money. (#3808) Currently, we treat typmod for smallmoney/money datatype as default which leads to output differences in many cases. Following are the fixes introduced in this PR : Introduce typmod handling for smallmoney/money datatype for objects like table/procedure/views/functions/casts and handling their upgrade scenarios. We are also handling p&s for declared variables, nested case expressions and unions having smallmoney/money as one of it's node. It also takes case of round vs truncation behaviour around edge cases for fixeddecimal multiplication Money/smallmoney and Numeric Arithmetic operations - precision and sclae correction and fixing TDS protocol Errors. T_Param node handling for fixeddecimal dataypes (money and smallmoney) when numeric is another operand. T_Aggref handling for Sum/Avg for fixeddecimal and other fixed length datatypes when numeric is another operand. Handing typmod for smallmoney/money in pg catalogs for views metadata and during dump-restore. Handling money/smallmoney typmod and fixeddecimal typmodin during dump-restore and by-passing typmod while deparsing for ISC check constraint. Avoiding crashes and wrong results by updating sanity checks and setting intermittent result size appropirately for bigint and fixeddecimal multiplication. Signed-off-by: Tanya Gupta tanyagp@amazon.com Cherry-pick PR : #3719 Engine PR : babelfish-for-postgresql/postgresql_modified_for_babelfish#586 Issues Resolved BABEL-5512, BABEL-5718, BABEL-5889, BABEL-5744, BABEL-5750, BABEL-5755, BABEL-5758, BABEL-5892, BABEL-5893, BABEL-5894, BABEL-5895, BABEL-5896, BABEL-5897, BABEL-5898
sharathbp
pushed a commit
to amazon-aurora/babelfish_extensions
that referenced
this pull request
Sep 22, 2025
…her branch is of smallmoney/money. (babelfish-for-postgresql#3808) Currently, we treat typmod for smallmoney/money datatype as default which leads to output differences in many cases. Following are the fixes introduced in this PR : Introduce typmod handling for smallmoney/money datatype for objects like table/procedure/views/functions/casts and handling their upgrade scenarios. We are also handling p&s for declared variables, nested case expressions and unions having smallmoney/money as one of it's node. It also takes case of round vs truncation behaviour around edge cases for fixeddecimal multiplication Money/smallmoney and Numeric Arithmetic operations - precision and sclae correction and fixing TDS protocol Errors. T_Param node handling for fixeddecimal dataypes (money and smallmoney) when numeric is another operand. T_Aggref handling for Sum/Avg for fixeddecimal and other fixed length datatypes when numeric is another operand. Handing typmod for smallmoney/money in pg catalogs for views metadata and during dump-restore. Handling money/smallmoney typmod and fixeddecimal typmodin during dump-restore and by-passing typmod while deparsing for ISC check constraint. Avoiding crashes and wrong results by updating sanity checks and setting intermittent result size appropirately for bigint and fixeddecimal multiplication. Signed-off-by: Tanya Gupta tanyagp@amazon.com Cherry-pick PR : babelfish-for-postgresql#3719 Engine PR : babelfish-for-postgresql/postgresql_modified_for_babelfish#586 Issues Resolved BABEL-5512, BABEL-5718, BABEL-5889, BABEL-5744, BABEL-5750, BABEL-5755, BABEL-5758, BABEL-5892, BABEL-5893, BABEL-5894, BABEL-5895, BABEL-5896, BABEL-5897, BABEL-5898
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR handles the dump/restore case for smallmoney/money and handles typmod for these dataype while coercing to domain.
Signed-off-by: Tanya Gupta tanyagp@amazon.com
Cherry-pick PR : #575
Extension PR : babelfish-for-postgresql/babelfish_extensions#3808
Issues Resolved
BABEL-5512
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the PostgreSQL license, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.