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

Postgres - expression index is not returning column names #181

Open
r-work opened this issue Mar 19, 2024 · 1 comment
Open

Postgres - expression index is not returning column names #181

r-work opened this issue Mar 19, 2024 · 1 comment

Comments

@r-work
Copy link

r-work commented Mar 19, 2024

I have the following index (example):

CREATE INDEX idx ON test_table (lower(column1))

When reading the schema, looking at test_table indexes, for that index the column name is lower (see attached screenshot).
Basically, it's neither returning the expression nor the column name.
Not sure what would be the best way to handle this, maybe just return the expression if the index is an expression?

Screenshot 2024-03-19 170549

@martinjw
Copy link
Owner

The underlying query we do is joining pg_catalog.pg_index , pg_catalog.pg_class and pg_attribute, the last gives us the attname which here is... "lower". Somehow there has to be a way to read from the pg_catalog tables that the index is a function, but that will take some research.

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

No branches or pull requests

2 participants