4,576 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
50
views
Error with primary key when inserting into Access with node-adodb
I have nodejs 25.0.0 and node-adodb. I am trying to insert into a MS Access database in a table that has a primary key (ID) that is set to auto-increment and has "required" set to true. I ...
-1
votes
0
answers
20
views
GUID v4 vs GUID v7 as SQL Server PK [migrated]
I've heard a lot that UUID v7 is performing much better in databases, when using it as primary key, due to the nature of how B-tree works. We have a huge problem with current implementation of PK as ...
6
votes
3
answers
224
views
Preserve a foreign key using a uniqueness constraint while dropping a primary constraint
I have a SQL Server database I mostly interact with using EF Core in a .NET project: I'll analogize my domain logic for simplicity.
I have a Fruits table holding general fruit data in columns Weight, ...
-3
votes
1
answer
88
views
Snowflake PK Enforcement [duplicate]
I can't get Snowflake to enforce a PK on an auto-increment column. The below code should not work, but, it does:
CREATE OR REPLACE TABLE IDENTITYTEST
(
ID INT AUTOINCREMENT START 1 INCREMENT 1,
...
-2
votes
2
answers
169
views
Unique constraint on partitioned table must include all partitioning columns [duplicate]
I'm trying to create this partitioned table in my PostgreSQL database:
create table messages_table (
id bigserial not null,
class_name varchar(255),
date_created timestamp,
service ...
1
vote
1
answer
123
views
How to generate CockroachDB-like unique_rowid() in PostgreSQL?
I was using CockroachDB previously, where I used unique_rowid() as my primary key, which generates a 64-bit timestamp-based unique ID (18-digit, time-sortable).
I've now migrated to PostgreSQL and ...
0
votes
3
answers
113
views
SELECT the (composite) primary key from a table
Given a table structure like
foreign_id
type
payload
1
A
I
1
B
II
2
A
III
with a named constraint (could be primary key, could be any other unique key) like tbl_pk(foreign_id,type) I would like to ...
0
votes
0
answers
67
views
EF Core throw an exception related to a schema where the queried entity is from another schema
I get this exception:
The entity type 'TblCentrale' requires a primary key to be defined.
If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'.
This is the code in ...
0
votes
1
answer
79
views
Why do I get an error when creating records from a map with a PK field in GORM, and is this a valid use case?
I’ve been learning GORM from the official docs, and I’m running into some confusion when trying to create records from a map using the Create() function.
The official documentation shows this example ...
1
vote
1
answer
139
views
EF Core: how to handle an entity without a database-generated key?
In Entity Framework Core 7, I have the following entity:
[Index(nameof(Time))]
[Table("DataEntries")]
public class DataEntry
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]...
2
votes
0
answers
90
views
Composite primary key with pg_party
I am trying to create a partitioned table by range on a rails application (7.2). I am using the create_range_partition function from the pg_party library. I want to set a composite pk on this table ...
0
votes
0
answers
170
views
Creating a partitioned table with Rails 7.2 and Postgres
I need to create a Postgres table partitioned by range. The partitioning approach is essential because the table will need to store large volumes of data and be queried frequently. The plan is to set ...
0
votes
1
answer
87
views
SQLite find primary keys in python
I am trying to describe the schema of this kaggle dataset.
Are there primary keys?
If there are primary keys, how do I figure out which they are?
Which columns are foreign keys?
# Reconnect to the ...
1
vote
1
answer
42
views
Make SQLite generate unique values of ROWID
I have table orders in an SQLite database:
CREATE TABLE orders
(
clientId INTEGER NOT NULL,
listId INTEGER,
exchangeId NOT NULL,
marketId NOT NULL,
id INTEGER NOT NULL,
...
0
votes
0
answers
88
views
Copying initial table data into a file using Primary key or ctid in postgresql
Im trying to copy initial table data around 100 to 200 GB to a file in text format.I created a connection-1 and started a transaction with isolation level REPEATABLE READ and exported a snapshot to ...