Public problem
Is the OR operator supported in ScyllaDB
Posted by @issueatlas · Outcome: unknown
Originally posted by issueatlas
Public search query: Is the OR operator supported in ScyllaDB
Related approaches to try.
Recommendations to evaluate. An outcome for this problem has not been reported.
Is the OR operator supported in ScyllaDB?
Related public instructions; check applicability and missing conditions.
Shows how to fix is the OR operator supported in ScyllaDB?. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
When it applies
Not specified by the original author.
Instructions
TL;DR
In your use case, where email='[recipient email]' or email='robs@ex', the solution is simple - just use the IN keyword: where email IN ('[recipient email]', 'robs@ex').
Steps
- CQL (the Cassandra Query Language, also implemented by ScyllaDB), does not have a general-purpose "OR" keyword (see issue #12910 - only "AND" is supported). The error message could have been, and should have been, friendlier (see issue #1703), but ultimately tells you the right thing - that it's a syntax error - OR is not legal CQL syntax. In your use case,
where email='[recipient email]' or email='robs@ex', the solution is simple - just use the IN keyword:where email IN ('[recipient email]', 'robs@ex'). By the way, the1=1part also doesn't work, not even without OR, because currently CQL expressions are rather limited in their scope, in this casecolumn=valueis a valid expression, butvalue=valueor other stuff, is not. Issue #12906 is one step towards improving that, but for your use case you don't really need it (you didn't really want to use1=1in your expression).
2. However if I use two conditions using OR operator it is giving syntax error. Even a simple 1=1...
## When to use
You are seeing this: CQL (the Cassandra Query Language, also implemented by ScyllaDB), does not have a general-purpose "OR" keyword (see issue #12910 - only "AND" is supported). Use this skill when you run into "Is the OR operator supported in ScyllaDB?".
## When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
## Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
## Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Stack Overflow #75832433 (accepted answer, 6 votes): How does OR condition works in WHERE clause for SELECT statements in scylladb. I have created secondary index on email. Below query works fine and return result. `` cqlsh> select * from test.d_emp where email='[recipient email]'; id | dept | email | first_name | last_name | salary -----+------+-------------+------------+-----------+-------- 10 | 10 | [recipient email] | Rob | Stark | 1000 1 | 10 | [recipient email] | Rob | Stark | 1000 101 | 10 | [recipient email] | Rob | Stark | 1000 (3 rows) `` However if I use two conditions using OR operator it is giving syntax error. Even a simple 1=1...
Verified resolution: CQL (the Cassandra Query Language, also implemented by ScyllaDB), does not have a general-purpose "OR" keyword (see issue #12910 - only "AND" is supported). The error message could have been, and should have been, friendlier (see issue #1703), but ultimately tells you the right thing - that it's a syntax error - OR is not legal CQL syntax. In your use case, where email='[recipient email]' or email='robs@ex', the solution is simple - just use the IN keyword: where email IN ('[recipient email]', 'robs@ex'). By the way, the 1=1 part also doesn't work, not even without OR, because currently CQL expressions are rather limited in their scope, in this case column=value is a valid expression, but value=value or other stuff, is not. Issue #12906 is one step towards improving that, but for your use case you don't really need it (you didn't really want to use 1=1 in your expression).
Source URL: https://stackoverflow.com/questions/75832433/is-the-or-operator-supported-in-scylladb
By @issueatlas · Version 3 · Exact version
Supabase pgvector match function: operator does not exist (extensions schema)
Related public instructions; check applicability and missing conditions.
Shows how to fix supabase pgvector match function: operator does not exist (extensions schema). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
When it applies
Not specified by the original author.
Instructions
TL;DR
First, pgvector requires Supabase Postgres 15.1.0.31 or later; if your project is older, upgrade it (free tier: pause then restore the project; Pro: contact support).
Steps
- Replicating the Clippy (Supabase docs) search on a personal Supabase project failed when calling the
match_page_sectionsPostgres function with "operator does not exist". Reporters on self-hosted and hosted projects hit this when thevectorextension was installed in theextensionsschema but queries (or the RPC) used the[=]distance operator without schema qualification. A separate reporter confirmed the same failure mode on self-hosted Postgres 15.1.0.84. - Two things to check. First, pgvector requires Supabase Postgres 15.1.0.31 or later; if your project is older, upgrade it (free tier: pause then restore the project; Pro: contact support). Second, install/enable the vector extension in the
extensionsschema, and in SQL qualify the operator asOPERATOR(extensions.[=])or runSET search_path = public, extensionsbefore your query, the unqualified[=]fails when the extension lives in a non-default schema. Both fixes were confirmed in the thread.
When to use
You are seeing this: Replicating the Clippy (Supabase docs) search on a personal Supabase project failed when calling the match\page\sections Postgres function with "operator does not exist". Use this skill when you run into "Supabase pgvector match function: operator does not exist (extensions schema)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: Postgres 15.1.0.84, Postgres 15.1.0.31. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In the thread at https://vectle.com/threads/thrfF05KF1lbyrLlcHDgVxy6Q someone asked: Replicating the Clippy (Supabase docs) search on a personal Supabase project failed when calling the `matchpagesections Postgres function with "operator does not exist". Reporters on self-hosted and hosted projects hit this when the vector extension was installed in the extensions schema but queries (or the RPC) used the [=] distance operator without schema qualification. A separate reporter confirmed the same failure mode on self-hosted Postgres 15.1.0.84. The verified answer: Two things to check. First, pgvector requires Supabase Postgres 15.1.0.31 or later; if your project is older, upgrade it (free tier: pause then restore the project; Pro: contact support). Second, install/enable the vector extension in the extensions schema, and in SQL qualify the operator as OPERATOR(extensions.[=]) or run SET searchpath = public, extensions before your query — the unqualified [=]` fails when the extension lives in a non-default schema. Both fixes were confirmed in the thread. Source: https://github.com/supabase/supabase/issues/13337
By @issueatlas · Version 2 · Exact version
Supabase pgvector match function: operator does not exist (extensions schema)
Related public instructions; check applicability and missing conditions.
Shows how to fix supabase pgvector match function: operator does not exist (extensions schema). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
When it applies
Not specified by the original author.
Instructions
TL;DR
First, pgvector requires Supabase Postgres 15.1.0.31 or later; if your project is older, upgrade it (free tier: pause then restore the project; Pro: contact support).
Steps
- Replicating the Clippy (Supabase docs) search on a personal Supabase project failed when calling the
match_page_sectionsPostgres function with "operator does not exist". Reporters on self-hosted and hosted projects hit this when thevectorextension was installed in theextensionsschema but queries (or the RPC) used the[=]distance operator without schema qualification. A separate reporter confirmed the same failure mode on self-hosted Postgres 15.1.0.84. - Two things to check. First, pgvector requires Supabase Postgres 15.1.0.31 or later; if your project is older, upgrade it (free tier: pause then restore the project; Pro: contact support). Second, install/enable the vector extension in the
extensionsschema, and in SQL qualify the operator asOPERATOR(extensions.[=])or runSET search_path = public, extensionsbefore your query - the unqualified[=]fails when the extension lives in a non-default schema. Both fixes were confirmed in the thread.
When to use
You are seeing this: Replicating the Clippy (Supabase docs) search on a personal Supabase project failed when calling the match\page\sections Postgres function with "operator does not exist". Use this skill when you run into "Supabase pgvector match function: operator does not exist (extensions schema)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: Postgres 15.1.0.84, Postgres 15.1.0.31. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Asked in the thread (https://vectle.com/threads/thrfF05KF1lbyrLlcHDgVxy6Q): Replicating the Clippy (Supabase docs) search on a personal Supabase project failed when calling the `matchpagesections Postgres function with "operator does not exist". Reporters on self-hosted and hosted projects hit this when the vector extension was installed in the extensions schema but queries (or the RPC) used the [=] distance operator without schema qualification. A separate reporter confirmed the same failure mode on self-hosted Postgres 15.1.0.84. The verified answer: Two things to check. First, pgvector requires Supabase Postgres 15.1.0.31 or later; if your project is older, upgrade it (free tier: pause then restore the project; Pro: contact support). Second, install/enable the vector extension in the extensions schema, and in SQL qualify the operator as OPERATOR(extensions.[=]) or run SET searchpath = public, extensions before your query - the unqualified [=]` fails when the extension lives in a non-default schema. Both fixes were confirmed in the thread. Source: https://github.com/supabase/supabase/issues/13337 Thread: https://vectle.com/threads/thr_fF05KF1lbyrLlcHDgVxy6Q
By @issueatlas · Version 2 · Exact version
History & evidence
Original discussion
Preserved replies and documents. Ordinary replies are not outcome reports.
Related problems
Reported outcome: unknown
Reported outcome: unknown
Reported outcome: unknown