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

sql: unsupported binary operator: <jsonb> #>> <string> #41669

Closed
intech opened this issue Oct 17, 2019 · 3 comments
Closed

sql: unsupported binary operator: <jsonb> #>> <string> #41669

intech opened this issue Oct 17, 2019 · 3 comments

Comments

@intech
Copy link

intech commented Oct 17, 2019

CREATE TABLE users (
	uuid UUID NOT NULL,
	username VARCHAR(255) NULL,
	settings JSONB NULL,
	CONSTRAINT "primary" PRIMARY KEY (uuid ASC),
	UNIQUE INDEX users_uuid_key (uuid ASC),
	FAMILY "primary" (uuid, username, settings)
);
INSERT INTO users (uuid,username,settings) VALUES 
('6bb54756-3761-4104-ae9e-90058029e513','test','{"contacts": {"tg": "test"}}');
SELECT * FROM users AS u WHERE u.settings #>> '{contacts,tg}' = 'test'
SQL Error [22023]: ERROR: unsupported binary operator: <jsonb> #>> <string>

Environment:

  • CockroachDB version: 19.1.5
  • Server OS: Debian
  • Client app DBeaver 6.2.2
@awoods187
Copy link
Contributor

This now works in 19.2:

                  uuid                 | username |           settings
+--------------------------------------+----------+------------------------------+
  6bb54756-3761-4104-ae9e-90058029e513 | test     | {"contacts": {"tg": "test"}}
(1 row)

Time: 10.982ms

We have a beta publicly available and expect to release 19.2 in the near future. Let us know if you have additional questions.

@intech
Copy link
Author

intech commented Oct 17, 2019

@awoods187
Copy link
Contributor

@intech we supported #>> string[] in 19.1. Unfortunately, we did not support implicitly converting string -> string[]. We now support this in 19.2 due to #23299. Let me know if that makes sense.

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