Skip to content

Conversation

@anju15bharti
Copy link
Contributor

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

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 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.

Dipesh Dhameliya and others added 4 commits December 16, 2025 12:44
…sh composite trigger

Commit 01463e1cccd33fb11b33a4dd6dbebcad3c534102 has been to ensure that
AFTER triggers run as the instigating user. In Babelfish, we have
separate logic to handle trigger so called TSQL composite trigger. We
need to set AfterTriggerSharedData.ats_rolid appropriately. Otherwise,
ats_rolid will get initilised to zero which will cause crash later.

Task: BABEL-6007

cr: https://code.amazon.com/reviews/CR-218668914
Starting with
postgres/postgres@14e87ff,
PRIMARY KEY CONSTRAINT is being prepared just like any other constraint.
Whereas Babelfish has special logic to handle utility like `ALTER TABLE
ADD PRIMARY KEY (colId ASC|DESC)` which is not natively supported in
PostgreSQL. Babelfish directly prepares IndexElem to hold the
information of ASC or DESC along with column. But since same
functionality is not available in PostgreSQL, PostgreSQL has certain
restriction using assertion inside ATPrepAddPrimaryKey and hence that is failing.

This commit appropriately handles IndexElem node within T-SQL dialect to
properly extract column key.

Task: BABEL-6010

cr: https://code.amazon.com/reviews/CR-217918385
(cherry picked from commit 12fed754dc54a119313cc2785e9c546b7d0e1ecd)
… BY and GROUP BY for babelfish

For ORDER BY and GROUP BY clause PostgreSQL resolves UNKNOWN target
entry to TEXT, and later updates the target entry with Vars. For
Babelfish these UNKNOWN target entries are not resolved hence Var
created has type UNKNOWN, which is later causing issue in coercion.
To fix this resolved string literal in target entry to sys.varchar
for ORDER BY and GROUP BY for babelfish.

Task: BABEL-6135
Signed-off-by: Rohit Bhagat <[email protected]>

cr: https://code.amazon.com/reviews/CR-227519704
…type for babelfish

In select_common_type() currently string literal has type unknownoid but
for babelfish, string literal should be of type sys.varchar, this is
causing incorrect results in babelfish in common type selection.
Fixed this by updating type of string literal as sys.varchar and also migrated babelfish related changes from select_common_type to babelfish pre-hook, select_common_type_hook.

Task: BABEL-6127
Signed-off-by: Rohit Bhagat <[email protected]>

cr: https://code.amazon.com/reviews/CR-227519704
@anju15bharti anju15bharti changed the title Stabilize failures [Do-not-squash-and-merge]Stabilize failures Dec 19, 2025
Yashneet Vinayak and others added 2 commits December 23, 2025 08:17
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.

3 participants