Closed asitemade4u closed 10 months ago
Hi @asitemade4u, the database won't let you insert a duplicate value for a primary key (or a unique index), so it doesn't sound like there's one on the table.
Yes, that is precisely what puzzled me so much. And yet, behold, this is the DDL of the table zzz.zzz
:
(
nam varchar(80),
cmt text,
nbr integer,
zzz_key serial
constraint zzz_pk
primary key
);
alter table zzz.zzz
owner to docker;
create unique index zzz_key_uindex
on zzz.zzz (zzz_key);
grant delete, insert, references, select, trigger, truncate, update on zzz.zzz to postgres;
There shouldn't be a way to insert duplicate values for zzz_key
into that schema, so I'd make sure you're not connected to a different database or using a different table.
Hi, and thank you for this excellent package!
I have tested
dbx
thoroughly but am hitting a snag ondbxUpsert
:dbx::Upsert
:1
as a value in the PK cell of the row of the tibble to be inserted,dbxUpsert
adds the record to the table without complaining although there is already a record with PK = 1 in the table.So I tried different things:
0
0
as the PK-1
-1
as the PKNA
NULL
What am I doing wrong?