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:
This now works in 19.2:
```[email protected]:53822/movr> SELECT * FROM users1 AS u WHERE u.settings #>> '{contacts,tg}' = 'test';
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.
@awoods187 In docs is wrong information for version 19.1.5:
https://www.cockroachlabs.com/docs/stable/functions-and-operators.html#supported-operations
@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 https://github.com/cockroachdb/cockroach/issues/23299. Let me know if that makes sense.
Most helpful comment
@intech we supported
#>> string[]in 19.1. Unfortunately, we did not support implicitly convertingstring -> string[]. We now support this in 19.2 due to https://github.com/cockroachdb/cockroach/issues/23299. Let me know if that makes sense.