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

Fix MVU failure due to sys.format_datetime, sys.format_numeric and sys.format functions #2023

Merged

Conversation

basasairohan
Copy link
Contributor

@basasairohan basasairohan commented Nov 16, 2023

Description

We are deprecating the older versions of sys.format_datetime, sys.format_numeric and sys.format functions in 2.7.0, Hence while doing major version upgrade sys.format_datetime(anyelement, nvarchar, character varying, character varying) is not found.

This changes catches the above error and deprecates the format functions only when they exist.

Signed-off-by: Sai Rohan Basa [email protected]

Issues Resolved

BABEL-4394

Test Scenarios Covered

  • Use case based - N/A

  • Boundary conditions - N/A

  • Arbitrary inputs - N/A

  • Negative test cases - N/A

  • Minor version upgrade tests - N/A

  • Major version upgrade tests - N/A

  • Performance tests - N/A

  • Tooling impact - N/A

  • Client tests - N/A

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.

@Deepesh125
Copy link
Contributor

In the description, use babelfish version instead of 14_10

Comment on lines 4152 to 4154
ALTER FUNCTION sys.format_datetime(anyelement, NVARCHAR, VARCHAR, VARCHAR) RENAME TO format_datetime_deprecated_3_4_0;
ALTER FUNCTION sys.format_numeric(anyelement, NVARCHAR, VARCHAR, VARCHAR, int) RENAME TO format_numeric_deprecated_3_4_0;
ALTER FUNCTION sys.FORMAT(anyelement, NVARCHAR, VARCHAR) RENAME TO format_deprecated_3_4_0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Separate out these three in different blocks

@basasairohan basasairohan changed the title Fix MVU failure due to sys.format_datetime function Fix MVU failure due to sys.format_datetime, sys.format_numeric and sys.format functions Nov 16, 2023
@Deepesh125 Deepesh125 merged commit 386c8c7 into babelfish-for-postgresql:BABEL_3_X_DEV Nov 16, 2023
28 checks passed
@Deepesh125 Deepesh125 deleted the mvu-fix branch November 16, 2023 09:33
basasairohan added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 16, 2023
…s.format functions (babelfish-for-postgresql#2023)

We are deprecating the older versions of sys.format_datetime, sys.format_numeric and sys.format functions in the
version 2.7.0, Hence while doing major version upgrade, sys.format_datetime(anyelement, nvarchar, character varying,
character varying) is not found. And similarly, sys.format_numeric(anyelement, NVARCHAR, VARCHAR, VARCHAR, int)
and sys.format(anyelement, NVARCHAR, VARCHAR) are also deprecated in older version which may cause an error.

This changes catches the above error and deprecates the format functions only when they exist.

Task: BABEL-4394
Signed-off-by: Sai Rohan Basa <[email protected]>
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