[Pg] Fix deeply nested queries failing due to table name length
Postgres has a 63 character limit on table and table alias names. Defining a relation with a long name, or using a query which retrieves multiple levels of relations, could generate a relation table alias name which exceeds this limit.
This PR fixes that by trimming off the beginning of the relation table alias names if they exceed this 63 character limit. The beginning was chosen, as I believe the end is more likely to contain information useful for identifying the relation in a query.
Node's crypto and the Crypto Web API are not available for use due to the available libraries configured in TypeScript. The replacement hashString function uses a completely made up hashing algorithm - it does not need to be secure. It just needs to generate unique outputs. I tested it to ensure it generates different outputs given similar strings.
Compared to #2991, this PR does not use Node's crypto package, and attempts to preserve the relation names instead of hashing the entire alias.
Fixes #2066. Closes #2991.
@opl- thanks for your PR! We can merge it, could you please resolve all the conflicts first?
Man it would be so nice if this got merged 🙏🙏.
Begging the maintainers to free me from the endless merge conflict resolution hell. (Accidentally rebased onto main instead of beta.)
I am dying to see this implemented, pretty please!
@AndriiSherman can this be merged? It is marked as ready-to-be-merged and there are no conflicts anymore. Seems like it's just been forgotten for a few months...
Please @AndriiSherman , desperately want this merged
@AndriiSherman, in the future. What can we do to get your attention? Because this is taking a while.
Please merge this, this issue is soooooo important to get merged in.
Looks like this has been approved - will this be merged shortly? I am about to spin up a fork but if this will be merged I'll probably wait - this is a pretty big fix that would reduce a lot of headaches in my codebase
Hey can you please merge and rollout this. I and many of us are urgently in need of this
This issue has hit me so many times. I cannot wait for this to be merged. PLEASE!
@AndriiSherman I had to resolve merge conflicts three times by now. Since maintainers of this repository are allowed to push to my branch, next time I'll be leaving that task up to you.
Hi! What's holding this up?
Really looking forward for this one too!
Any update on this?
Thanks for working on fixing this issue. Do we have a date for this pull request to be merged ?
Any updates on this one?
Been forever since I wanted a PR merged more than this one.
What's preventing this PR from getting merged?
@AndriiSherman can we expect this to be merged before the next release?