Skip to main content

Questions tagged [cockroachdb]

Questions related to CockroachDB and how to install and set it up (secure and insecure) and run it across a cluster on any/all of the cloud vendors - and also on local/private clouds. Any particular database issues with CockroachDB (e.g. performance, PostgreSQL compatibility). Other database matters touching on CockroachDB as a db system would also be on-topic.

Filter by
Sorted by
Tagged with
1 vote
2 answers
111 views

How to generated missing dates between date range that do not exist in the joined table in CockroachDB?

I have Table A and Table A which have Table A id, start_date, end_date Table B id, table_a_id, archive_date I want to return the dates that are missing in Table B, the dates that are NOT in the ...
Brunaldo's user avatar
1 vote
2 answers
40 views

Inserting a Hyphen in between a composite primary key

I have more of a conceptual question. Is there a way to model the following: CREATE TABLE AssetPair ( older_asset_id INT8, newer_asset_id INT8, PRIMARY KEY (older_asset_id, '-', ...
Eric Sharma's user avatar
1 vote
1 answer
51 views

Moving records between tables in CockroachDB is taking too long

I have a requirement where I have to move records from table original_table to table new_table for the last N days. Below is a small sample of my basic script that does this. while True: result = ...
Brunaldo's user avatar
0 votes
1 answer
156 views

RSUs and Requests in CockroachDB?

Based on the free tier in cockroachDB Serverless, 250 Million free RSUs are available. On that note, how many requests can this database handle within 250M RSUs approximately?
S3emingly's user avatar
1 vote
1 answer
303 views

A query, safe against concurrent writes with READ COMMITTED, also safe with SERIALIZABLE isolation level?

I have asked this question with a wonderfully informative answer: How to have uniqueness constraints for structures across multiple tables? The answer from Erwin Brandstetter suggests this: WITH ...
Lance's user avatar
  • 211
0 votes
1 answer
286 views

What happens to the n tables you insert into during a transaction?

With a database structure sort of like this: create table objects { uuid id; string type; } create table object_properties { uuid id; uuid source_id; // the object which has this property ...
Lance's user avatar
  • 211
1 vote
1 answer
1k views

How to have uniqueness constraints for structures across multiple tables?

Say I have a schema system something like this: create table objects { uuid id; string type; } create table object_properties { uuid id; uuid source_id; // the object which has this property ...
Lance's user avatar
  • 211
3 votes
1 answer
1k views

Update all instances of key inside nested JSON array

I'm trying to update a complex JSON document stored in a table in CockroachDB. The CockroachDB query language is mostly Postgres compatible except for the lack of procedural code, so a Postgres answer ...
JRL's user avatar
  • 31
0 votes
1 answer
119 views

CockroachDB upgrade not finalized

I am running a three-node CockroachDB docker cluster (Debian OS) and I recently upgraded the cluster from version v21.1 to version v21.2 following the procedure outlined in the documentation using the ...
agrajag_42's user avatar
0 votes
1 answer
189 views

CockroachDB or mariaDB cluster for many read slaves, 1 master?

I am after a recommendation on the following setup... 1 Master that has all tables. 1 main table ( table A ) that master will write to, and read. often. 5+ tables ( tables B+ ) master will read from ...
PixelPaul's user avatar
  • 109
0 votes
1 answer
209 views

Error: pq: 1 columns must reference exactly 1 columns in referenced table (found 2) [closed]

I have a few tables and I am facing this issue most likely with the table "item". When I remove restaurant_id and category_id, it works fine. CREATE TABLE IF NOT EXISTS restaurant ( id ...
Taufiq Rahman's user avatar
1 vote
1 answer
826 views

Replicate Postgres to Cockroach

We are planning to replicate our Postgres database to Cockroach. We are looking for a relatively simpler solution to achieve that. Currently, we are working on a Stream based replication (something ...
Noobie's user avatar
  • 165
-2 votes
1 answer
243 views

Is it efficient to design chat/likes/relationship database in separate table per user? [closed]

The specs: there would be about 1 billion users there would be probably 1 million topics each topics has subtopics stored at the same level as topics user has many to many relationship with topics (...
Kokizzu's user avatar
  • 1,373