Pq: cluster version does not support JSONB (>= 2.0 required)

postgresql
sql
bug
sqlschema
import

(bharath) #1

We are using CockroachDB. We are trying to “import” a .sql dump file using command.

cockroach sql --database=database name < file-name.sql --insecure

After pressing the enter the tables without Jsonb are created in the database and throwing an error saying:

pq: cluster version does not support JSONB (>= 2.0 required)

Error: pq: cluster version does not support JSONB (>= 2.0 required)
Failed running “sql”

Our cluster version is same as the version of CockroachDb v2.0.5(Latest). We already tried to upgrade and things like that but no luck.

Our cluster build version:

build:CCL v2.0.5 @ 2018/08/13 17:59:42 (go1.10)


(Roland Crosby) #2

Hi @bharath, did you upgrade your cluster from a previous version of CockroachDB? If so, make sure you finalize the upgrade to properly set the cluster version.


(bharath) #3

Sry, I forgot to update my answer here. Yes I resolved the problem using finalize the upgrade
By setting

SET CLUSTER SETTING version = crdb_internal.node_executable_version();

Thanks, @rolandcrosby for your inputs.