ERROR : Postgres backed column with a non-deterministic collation
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with Administrate::Search and its query_template method, using the reported PostgreSQL nondeterministic-collation search case as the reproduction. Compare the current LIKE query with the provided local override and investigate whether the behavior can remain agnostic across collations. Done means dashboard searches no longer raise the reported PostgreSQL error while retaining supported collation behavior.
Written by the indexing model from the issue text.
Description
-
What were you trying to do?
Perform a search on a dashboard with a Postgres backed column with a non-deterministic collation -
What did you end up with (logs, or, even better, example apps are great!)?
PG::FeatureNotSupported: ERROR: nondeterministic collations are not supported for LIKE
- What versions are you running?
- Rails (6.1.4)
- administrate (0.17.0)
We have currently worked around the issue locally by doing a class_eval on Administrate::Search and re-defining the query_template
Administrate::Search.class_eval do
# we need to override the LIKE query to explicitly set the COLLATION so Postgres doesn't complain
def query_template
search_attributes.map do |attr|
table_name = query_table_name(attr)
searchable_fields(attr).map do |field|
column_name = column_to_query(field)
"LOWER(CAST(#{table_name}.#{column_name} AS CHAR(256))) LIKE ? COLLATE \"default\""
end.join(" OR ")
end.join(" OR ")
end
end
Not sure if there's a more agnostic approach that would allow for collation support?
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thoughtbot/administrate
-
dependencies
Difficulty 4/5 3-5 days Newbie friendliness 35/100
thoughtbot/administrate#3061 ·
-
dependencies
Difficulty 5/5 Over a week Newbie friendliness 35/100
thoughtbot/administrate#3060 ·
-
Dependabot grouping Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
thoughtbot/administrate#3020 ·
-
javascript views-and-styles
Difficulty 3/5 1-2 days Newbie friendliness 25/100
thoughtbot/administrate#2979 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
thoughtbot/administrate#2978 · 3 comments ·
All issues in thoughtbot/administrate
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100