Questions tagged [cockroachdb]
A scalable, geo-replicated, transactional SQL datastore developed in Go.
329
questions
1
vote
1
answer
11
views
Speed of CockroachDB schema changes during unit tests
I have issues with schema changes in my testing infrastructure. We use a unit test framework, and truncate our database between each unit test. I've noticed that running a series of CREATE statements ...
1
vote
0
answers
35
views
Moving data from SQL Server tables to Cockroach database [closed]
This question may be more on ideas/suggestions if someone in community has done or performed something similar.
We have few tables in SQL Server database that needs to move out from current database ...
1
vote
1
answer
16
views
How to generate a version1 uuid in Cockroachdb
Our current datastore is Cassandra. We're planning to move away from it towards Cockroachdb wherein we need to refactor our code(Spring boot). The current scripts use the datatype 'timeuuid' which ...
2
votes
2
answers
54
views
Delete element from jsonb array in cockaroachdb
I got field with jsonb tags: [{"value": "tag1"}]
I need to do something like this update table1 set tags = tags - '{"value": "tag1"}' - but this don't work
What ...
0
votes
0
answers
61
views
how can i connect code to my local cockroachdb cluster using NodeJs?
According to this tutorial, I created a local cockroachdb cluster with three nodes in the docker:
https://www.cockroachlabs.com/docs/v21.2/start-a-local-cluster-in-docker-windows
Now i try connect to ...
1
vote
1
answer
31
views
.sst files are daily increasing in cockroachdb on path /var/lib/cockroach/cockroach-data
.sst files are daily increasing in cockroachdb on path /var/lib/cockroach/cockroach-data
daily there are lots of .sst files are getting created in my cockroachdb cluster at the host path /var/lib/...
0
votes
2
answers
73
views
Can Distributed SQL tools be applied as alternatives to 2 phase commit or sagas patterns for distributed transaction coordination?
I am currently reading the Microservices Patterns and it says there are mostly two approaches for distributed transactions: two phase commit (2PC) and sagas pattern.
Also, I've heard about currently ...
1
vote
2
answers
45
views
Shard key with mostly even distribution. How to handle outliers?
I'm learning about sharding approaches. How to achieve good horizontal scalability with a large number of shards in an IO-heavy application. Below I describe a case that I expect to see in my app. I ...
-1
votes
1
answer
66
views
How do these database management systems practically behave during a network partition?
I am looking into deploying a database management system, replicated across regions (various data centers across a country). I am currently looking into the following candidates:
MongoDB (NoSQL, CP ...
2
votes
1
answer
14
views
How do you configure the number of replicas per table or database?
On Cockroachdb, is it possible to configure the number of replicas per table or database?
1
vote
0
answers
25
views
CockroachDB C++ transaction retry issue
I'm trying to run the basic C++ example, basically:
void executeTx(
pqxx::connection *c, function<void (pqxx::dbtransaction *tx)> fn) {
pqxx::work tx(*c);
while (true) {
try {
...
3
votes
1
answer
35
views
How to get the estimated row count for paginated queries CockroachDB
How would I see how many rows were scanned in my query? Im using LIMIT so i know how many rows are going to be returned but i'd like to see how many rows were scanned.
0
votes
0
answers
77
views
Camunda CockroachDB RETRY_SERIALIZABLE exception
I am using CockroachDB with Camunda framework, so all the DB transactions are managed by the Camunda engine. I keep getting the following exception:
org.springframework.orm.jpa.JpaSystemException: ...
0
votes
1
answer
22
views
show filter values even if the data is not available in table
So there is the Table and their contents As shown below.
id
title
image
1
First
row
2
Second
row
3
third
row
So if we see in the table there are only 3 records and the id are 1,2,3
There is no ...
0
votes
1
answer
62
views
Using Flyway for two databases, but only one at a time
I'm testing out PostgreSQL and CockroachDB with my application. I've got it such that I can run my application with either PostgreSQL OR CockroachDB. Is it possible to set Flyway up such that I can ...
0
votes
0
answers
47
views
Problem reading from rest api with autogenerated BigInt Id
I'm having some issues with my rest api when I try to read from database.
My server stack right now is NestJS + Prisma + Cockroachdb
At first when I generated a new User, with a POST, all went great ...
0
votes
1
answer
48
views
How do I clone a schema?
Suppose I have an existing schema (s1) with the following tables:
s1.table1
s1.table2
I would like to clone this schema to a new schema (s2) i.e.:
s2.table1
s2.table2
How can I achieve this?
The ...
0
votes
1
answer
33
views
Using CockroachDB's RESTORE command, how can I restore a database into another database name?
I have a backup of a CockroachDB database named foo, and I would like to restore it on my cluster but have the database name be bar. When I try RESTORE DATABASE foo ... WITH into_db=bar, I get an ...
1
vote
1
answer
25
views
cockroachdb: print only tuples
is there any output option for cockroach sql command to print only tuples without column names and rows count?
psql has -t, --tuples-only print rows only flag.
0
votes
0
answers
136
views
Insert into Multiple tables using JPA @Query
Insert JSON values into multiple tables using JPA and spring-boot.
User Table
@Entity
class User {
private @Id @GeneratedValue Long id;
private String name;
@OneToOne(cascade = {
...
0
votes
0
answers
75
views
"PSQLException - cannot create enum of unspecified type" when using enum type in where clause
We are using JDBI in Kotlin with cockroachDB. I am seeing the below error when a field of type enum is queried in where clause
"errorMessage":"org.postgresql.util.PSQLException: ERROR: ...
0
votes
1
answer
106
views
How to create / login to a user in CockroachDB
I have created a local cockroachDB using:
cockroach sql --insecure
and when I am trying to create a user using:
create user 'name' with password 'password';
I get a error:
ERROR: setting or updating ...
1
vote
1
answer
68
views
How to migrate StatefulSet to different nodes?
I have a Kubernetes cluster of 3 nodes in Amazon EKS. It's running 3 pods of Cockroachdb in a StatefulSet. Now I want to use another instance type for all nodes of my cluster.
So my plan was this:
...
1
vote
1
answer
60
views
cockroachdb Daily backup from EKS cluster
I need to take daily backup for cockroachdb and push to S3 , its running under EKS cluster with statefulset, So can anyone suggest the best method to do this please.
Thanks.
0
votes
0
answers
100
views
Multi-node secured Cockroach Db cluster with docker
I have been able to create a single node insecure cluster using below docker command:
docker run -d --name cockroach -p 26257:26257 -p 8080:8080 <my_artifactory>/cockroachdb/cockroach:v20.1.6 ...
0
votes
1
answer
97
views
How do I fix a "Message was too large, server rejected it" error in a cockroachdb changefeed?
When I run a changefeed into Kafka, it emits messages for a while, but then gets stuck. In the job status or logs I see the error kafka server: Message was too large, server rejected it to avoid ...
1
vote
1
answer
19
views
Cannot upgrade to 21.2 because decomissioned node is unavailble - Cluster Version Error
When I try to SET CLUSTER SETTING to 21.1, an error message says “ERROR: n2 required, but unavailable” (n2 is reference to a node, but n2 doesn’t exist, because I can see it as decommissioned 2 years ...
1
vote
2
answers
111
views
Do we need to add any configuration on client side to avoid transaction retry errors in cockroach database
when there is concurrent updates happening on the same record, transaction 1 is able to update but as per the cockroach database documentation transaction t2 should be on queue, but transaction t2 is ...
1
vote
1
answer
48
views
Cockroach oddly auto incrementing on PK id at server but not local (knex.js seeding cockroach public cloud hosted db)
I can't for the life of me figure out why this is happening. Each time I run my table delete / create migration then seeding logic on the server DB it will give me bizarre 18 digit ids instead of ...
1
vote
2
answers
164
views
Which distributed SQL databases put data from different tables with the same tenant in the same node?
I’m designing a SQL data schema with many tables that have a compound primary key of (customer_id, id). The application will frequently need to run JOIN queries to assemble data. However, it should ...
0
votes
1
answer
58
views
Migrate postgres data into cockroachDB
I'm trying to migrate all my data from Postgres (13) into CocroachDB.
I found this: https://www.cockroachlabs.com/docs/stable/migrate-from-postgres.html
I dumped data, then try to import using:
IMPORT ...
2
votes
1
answer
79
views
How to resolve ReadWithUncertainityInterval in cockroach database with springboot
While performing write/read operations in cockroach database with springboot, we are getting below error intermittently. Any solutions here is appreciated. Thanks
Caused by:
org.postgresql.util....
0
votes
1
answer
60
views
How to migrate all the data of an sqlite database to cockroachdb (for a django project)
I created a Django application and deployed it for testing purposes. I now have data which i would not like to lose, but i want to use cockroachDB for storing the web-app data. The SQLite database is ...
0
votes
1
answer
85
views
Spring rollback transaction from 2 Separate Databases
I have a Spring Boot server that collects 2 gRPC microservices - one of them works with the DynamoDB and another CockrachDB database. I need to make sure the commit works fine in both of the DB's and ...
1
vote
2
answers
63
views
Is it normal that CockroachDB Serverless uses 500K RUs in 19 hours with no connections?
I set up a CockroachDB cluster for a school project. The only thing I have done is created 1 database with 1 table with 1 instance of 6 rows, but when I look at the dashboard I have already used 500K ...
0
votes
1
answer
46
views
Query on an indexed geometry column using CockroachDB on Windows
I'm getting the following error on cockroachDB when running a GIS query on an column with indexed GIS data:
[XXUUU] ERROR: geos: error during GEOS init: geos: cannot load GEOS from dir "/usr/...
1
vote
1
answer
2k
views
Invalid `prisma.mytable.create()` invocation: Foreign key constraint failed on the field: `(not available)` when using cockroachdb
I'm attempting to use Prisma with Cockroachdb locally. I understand that official support for CockroachDB is in the works.
I have a parallel local PostgreSQL database where everything is working ...
1
vote
3
answers
79
views
Spring JPA Paging to Stream
We are currently using cockroach DB, but this doesn't support returning X records at a time presumably due to lack of cursor support. This means that when trying to stream a large number (~10 million) ...
1
vote
1
answer
71
views
Cockroach-DB - wrong calculation of date difference
I'm using CockroachDB v20.1.1 and getting wrong results for date calculations:
Example:
$> select '2021-10-28'::date - interval '1 years'; ==> 2020-10-28 00:00:00 is correct
$> select '2021-...
1
vote
2
answers
208
views
How do I connect DBeaver to CockroachDB Serverless?
How do I connect DBeaver with my CockroachDB Serverless database? I get errors that look like this:
FATAL: codeParamsRoutingFailed: missing cluster name in connection string
0
votes
1
answer
138
views
How do I connect JetBrains DataGrip to CockroachDB Serverless?
I'd like to use JetBrains DataGrip with CockroachDB Serverless.
How do I create a connection? I get errors that look like this:
[08004] FATAL: codeParamsRoutingFailed: missing cluster name in ...
3
votes
2
answers
197
views
How do I connect Ecto to CockroachDB Serverless?
I'd like to use CockroachDB Serverless for my Ecto application. How do I specify the connection string?
I get an error like this when trying to connect.
[error] GenServer #PID<0.295.0> ...
1
vote
1
answer
103
views
Random spikes in usage (CockroachCloud Serverless)
I recently set up a free CockroachDB Serverless cluster on CockroachCloud. It's been really great so far, but sometimes there are random spikes in Request Units even though the amount of SQL ...
0
votes
0
answers
289
views
How to get all elements where one STRING ARRAY contains ANY of the elements in another STRING ARRAY?
I have a table with a STRING ARRAY column and I'm trying to get all rows, in which the Array column contains elements from another STRING ARRAY.
F.E:
CREATE TABLE a (b STRING[]);
INSERT INTO a VALUES
...
1
vote
1
answer
30
views
What are the potential issues when removing interleaved tables from CockroachDB?
With interleaving being deprecated in Cockroach v21, I have some tables that I'm trying to alter. These exist in a hierarchy with the primary of each being interleaved into its parent. No secondary ...
0
votes
0
answers
47
views
Is there a way to maximize RAM usage while importing data with CockroachDB?
We are importing a lot of data into a CochroachDB using the IMPORT INTO command.
Our machines have 768GB of RAM. I am concerned because the IMPORT is using around 256GB only.
Is there a way to ...
2
votes
0
answers
68
views
PHP PDO will not generate an error for non-existing database
My question:
Why does new PDO() not display an error message if I give it the name of a database that does not exist on the server?
My database server is CockroachDB v21.1.8 which supports most of ...
1
vote
0
answers
67
views
How to structure array data in CockroachDB for maximum performance?
CockroachDB does not allow indexing of array fields, which means we must probably work around this limitation using a lookup table. But because only one index can be processed per query (assuming this ...
1
vote
1
answer
32
views
When we have 3 node with 2 data centers, how we can down 1 of dc completely and can use it? during Disaster recovery
We have a 3 node by 3 node in 2 data centers (6 nodes). And as per example scenarios mentioned in Cockroachdb portal we can only down 2 nodes and must be 4 nodes available. However in our case, we ...
1
vote
2
answers
54
views
cockroarch DB "conn closed"
var db *pgx.Conn //database
func ConnectCockroachDB() {
var dbUri string = "testurl"
conn, err := pgx.Connect(context.Background(), dbUri)
...