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

[Enhancement]: Remove instances of relnamespace::regnamespace casting in system view, function, or procedure implementations #190

Open
1 task done
avneet-toor-bq opened this issue May 12, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@avneet-toor-bq
Copy link
Contributor

Contact Details

[email protected]

What this feature/enhancement tries to solve?

In some system view, function, or procedure implementations we see relnamespace::regnamespace casting going on. For example:

select 
...
from pg_class t
where t.relnamespace::regnamespace::text = 'sys';

This kind of casting should be avoided. Modify the system object implementation to remove this casting but still have the view/function/procedure work correctly.

If want to provide us a more details about how to implement.

No response

Version

babelfishpg_tsql (Default)

Relevant documentation

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nasbyj
Copy link
Contributor

nasbyj commented May 12, 2022

Also, there's really no reason for there to be two "levels" on these views. Instead of

SELECT CAST(object_id AS int) ...
  FROM (SELECT i.indrelid AS object_id ...)

Just do

SELECT i.indrelid::int AS object_id

(or CAST (i.indrelid AS int) AS object_id if you prefer)

@suprio-amzn suprio-amzn assigned jsudrik and unassigned amazon-auto Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants