WITH clause in Cockroach


I am having a postgres query like below -

WITH upsert AS
  (UPDATE keyval
   SET valueString = '12121',
       expiryTime = '9878'::int8,
       VERSION = VERSION + 1
   WHERE customerId = 0
     AND keyString = 'IPMetaDataKey' RETURNING *)
INSERT INTO keyval (customerId, KeyString, ValueString, ExpiryTime)
    (SELECT *
     FROM upsert) 

On running this in cockroach I am getting an error like this

ERROR: unimplemented at or near ")"

Is WITH clause not supported in Cockroach? I am not able to locate this in docs.

Not supported yet, unfortunately.

Do you know about when you’ll be looking to support this? Is it supported in the enterprise version? The link provided looks to be open about a year ago, so just wondering where it is on the roadmap.


I believe our plan is to include them in version 1.3, which should release a little under a year from now, but cc @dianasaur323 in case I’m off the mark.

Yep, currently marked as 1.3, although this may change as we are still finalizing our 1.3 plans. cc @awoods187