1,284 questions
2
votes
2
answers
180
views
How to avoid "ON CONFLICT DO UPDATE command cannot affect row a second time" error in WITH statement
I have two tables: demo at db<>fiddle
Table keywords has two columns id and v (which hold the keyword's value)
create table keywords(
id int generated always as identity primary key
,v text ...
0
votes
1
answer
34
views
Upsert! Operation Throws "A table can't contain duplicate column names" Error
I have a base table A and a result table B in DolphinDB. Table B was initially empty and is used to store calculated results based on table A. When trying to insert the calculated results into table B,...
2
votes
1
answer
113
views
MongoDB C# Driver: Update only provided fields, including setting some fields to null
I am using MongoDB with C# (MongoDB.Driver) and I want to update only the fields provided in my API model. My current approach works for updating values, but I cannot set a field (string, number, or ...
1
vote
1
answer
159
views
Problem with INSERT and UPDATE Trigger in case of INSERT ON CONFLICT in Postgres
I have a problem regarding ON INSERT BEFORE triggers firing on rows that are inserted via insert on conflict update upserts.
I have a postgres (v.17) database with a base table or super table that 5 ...
0
votes
1
answer
75
views
use activerecord-import to upsert only when values have changed
How to use activerecord-import to upsert only when values have changed?
Body:
I'm using the activerecord-import gem in a Rails 6 app to bulk upsert data into a PostgreSQL database. Here's an example ...
0
votes
0
answers
58
views
Apply Merge from Bronze DLT Table into Silver DLT Table with some light cleaning? (Traditional Upsert style)
I am trying to create a DLT pipeline and this is my first time doing it. What is the best possible way to satisfy my following requirements. I am fully aware that the path I am choosing may not be ...
0
votes
0
answers
74
views
Create a Vertex AI Index with STREAM_UPDATE
I'm trying to create an index using the following metadata file and cli command. (All names are fake). It creates an index with a BATCH update. I need to upsert datapoints and that requires an index ...
2
votes
1
answer
99
views
Insert or update when importing from JSON
My SQLAlchemy ORM model is populated by a JSON file that occasionally changes. The JSON file does not provide an integer primary key but has a unique alphanumeric ProductCode. My model:
class ...
0
votes
1
answer
129
views
Python CosmosDB upsert_item deletes document
I am going to update a document using upsert_item function of CosmosDB Python SDK.
Here is a script:
from dotenv import load_dotenv
from azure.cosmos import CosmosClient
import os
import uuid
def ...
2
votes
1
answer
166
views
Postgres / SQL pattern for atomic SELECT and UPDATE or INSERT within a transaction
I have a simple scenario, where I want to atomically read and modify the state of a row. But the row may not exist yet.
For this example, I use the user_group_membership table:
user_id (pk) | group_id ...
0
votes
2
answers
104
views
Adding column in upsert using on_conflict_do_update
I'm trying to add a timestamp column, updated_at, in the updates when doing a upsert using on_conflict_do_update. Below is my current implementation but encounter the below error when running at the ...
0
votes
0
answers
719
views
Upload document into Flowise AI via API endpoint
I have an OpenSAAS (react) application, and a Flowise flow with document uploader and Supabase vector store. The chatbot is currently embedded on the website just fine. I added an upload button for ...
0
votes
2
answers
255
views
Where the Upsert Kafka connector consumer start?
I'm trying to read from kafka in upsert mode. Everything works fine. But I noticed that scan.startup.mode is not supported.
Is my assumption right that in upsert mode kafka connector reads the whole ...
2
votes
1
answer
51
views
Use $push to add an existing document field to an array to the same document
I have a document with fields "MyElement" and "MyArray". I want to update my entire collection so that MyElement also appears as the initial item of MyArray.
I tried the following, ...
1
vote
0
answers
58
views
Sybase ClassCastException: Cannot cast java.lang.String to com.sybase.jdbc4.jdbc.SybLob
I am trying to save String of size 1500 characters in Sybase table which has a column of TEXT datatype, however I am facing error as below
ClassCastException: Cannot cast java.lang.String to com....
2
votes
1
answer
144
views
sybase merge query with where clause in insert or skip the insert on condition
I have a table with account_number, amount , last_updated_time.
I wrote a merge query as below
MERGE INTO account AS target
USING (SELECT ?,?,?)
AS SRC(account_number, amount , last_updated_time)
ON ...
1
vote
1
answer
71
views
Running an update() with parameters from df.to_dict() causes errors
I am attempting to implement a functionality whereby a table in a SQL Server database is updated as per the contents of a pandas dataframe.
I check for overlapping IDs in the database table and in the ...
0
votes
0
answers
187
views
Need to upsert vectors in pinecone DB in Next JS
So I need help pushing vectors into the db, currently something is wrong with the await function here, I am getting an error.
Here is my code for the pinecone.ts file that uploads to the db:
import {
...
0
votes
1
answer
351
views
Upsert_all with uniqueness index constraint
I'm facing a dilemma.
I've created a model with an wave_order column with uniqueness db index with wavable. wavable is a polymorphic (but we don't care actually).
# migration
create_table :...
1
vote
2
answers
1k
views
Upsert on Conflict with sqlalchemy 2.x and Postgresql
I am using python to query an external api, transform the data and write it to a postgresql database internally.
In that process, I am comparing the result from the api with existing data in the ...
2
votes
1
answer
559
views
Confusion about what Room "Upsert" returns after a successful update
I read somewhere (can't remember the source) that Upsert usually returns -1 if an error occurs. Recently in my project I have observed that Upsert is returning -1 - even though the update is ...
0
votes
1
answer
25
views
Update a table only if updated field is higher
I'm triying to upload some files with incremental data. The tabla has a PK (_id), but this _id could appears in many files with different values.
I'd like to load massively the files with a REPLACE ...
3
votes
2
answers
551
views
MongoDB update a document's array element at specific index and insert a new document when there's no match
UPDATE: the real purpose of this question is to find a FAST solution, I'm new to MongoDB so I thought it's fast if use a single query, however, any fast solution is okay.
Basically I'm looking for a ...
0
votes
1
answer
69
views
How to upsert LineString in ArcGIS python via CSV (or other suggestion?)
I have been working on an ETL process to push / upsert my data from PostgreSQL into ArcGIS Online into a lines feature layer to be included on a WebMap. I have had no problem with using essentially ...
0
votes
0
answers
165
views
Postgres Upsert Returning with FOR UPDATE lock
I have a table that records requests to an external API for data enrichment. I want to ensure that there is only one row for a given entity with status = 'Pending' (meaning a process is doing the work....