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

Add MIN and MAX aggregate support for MONEY datatype #3410

Open
wants to merge 7 commits into
base: BABEL_5_X_DEV
Choose a base branch
from

Conversation

roshan0708
Copy link
Contributor

@roshan0708 roshan0708 commented Jan 15, 2025

Description

This commit addresses the issue where SELECT...INTO with MIN and MAX aggregations on MONEY columns lost type information. The fix implements proper type preservation for these aggregate functions when used with MONEY datatypes.

Key changes:
Added support for MIN(money) -> money
Added support for MAX(money) -> money
Ensures type consistency in SELECT...INTO operations

Issues Resolved

Task: BABEL-5479

Test Scenarios Covered

  • Use case based - y

  • Boundary conditions - y

  • Arbitrary inputs - y

  • Negative test cases - y

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, 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.

This commit addresses the issue where SELECT...INTO with
MIN and MAX aggregations on MONEY columns lost type information.
The fix implements proper type preservation for these aggregate
functions when used with MONEY datatypes.

Key changes:
Added support for MIN(money) -> money
Added support for MAX(money) -> money
Ensures type consistency in SELECT...INTO operations

Task: BABEL-5479
Signed-off-by: Roshan Kanwar <[email protected]>
@coveralls
Copy link
Collaborator

coveralls commented Jan 16, 2025

Pull Request Test Coverage Report for Build 12856128328

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 74.967%

Totals Coverage Status
Change from base Build 12832248351: 0.01%
Covered Lines: 47000
Relevant Lines: 62694

💛 - Coveralls

@roshan0708 roshan0708 requested a review from Deepesh125 January 20, 2025 05:12
GO

-- Complex Dependent Objects Test
CREATE VIEW MoneyView AS SELECT Amount FROM TestMoneyTable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also select max(amount) from

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.

4 participants