question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with Expression index

See original GitHub issue

I am triing to ensure that my context is synced with external schema. I am triing to scaffold context, but ef failed with error about expression index.

Expression index 'ux_bla_bla' on table private.awesome_table cannot be scaffolded, expression indices aren't supported and must be added via raw SQL in migrations.
System.NotImplementedException: The method or operation is not implemented.

I can’t drop that index because of ther reasons and i can’t skip it (or i don’t know how) Could you pls provide some flag or method to complete scaffold with warning about skipped objects or allow to skip em manually?

i am usin “dotnet ef dbcontext scaffold” command

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
objectOlolocommented, Oct 15, 2019

2.2. I guess if i use 3.0 version of provider would be 3.0+

0reactions
rojicommented, Oct 16, 2019

@WhoStoleMyNick yeah, as the exception message says, the Npgsql EF Core provider doesn’t support expression indices in any way. This is tracked by https://github.com/npgsql/efcore.pg/issues/119 and hopefully will happen one day. But you can still set them up via raw SQL in your migrations, so this shouldn’t be blocking.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-expression indexes in PostgreSQL not using being ...
1 Answer. It looks to me like there is a conflict between the single-expression and the multi-expression indexes. All applicable indexes are ...
Read more >
Why does my expression index not accept the same syntax ...
But then when trying to create an expression index with it, there is a syntax error: # create index on mytable (start_date +...
Read more >
Problem with Expression index · Issue #18382 · dotnet/efcore
I am triing to scaffold context, but ef failed with error about expression index. Expression index 'ux_bla_bla' on table private.awesome_table ...
Read more >
Documentation: 15: 11.7. Indexes on Expressions
An index column need not be just a column of the underlying table, but can be a function or scalar expression computed from...
Read more >
On the usefulness of expression indexes
The database is unable to use the index for multiple reasons. Indexes (at least btree indexes) rely on querying sorted data, provided by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found