Here is the error reproduced:
postgres=# create table owners( contract_address varchar(100) primary key ,owner_address varchar(100),owns_sticker int, owns_balloon int);
CREATE TABLE
postgres=# INSERT INTO owners (contract_address, owner_address, owns_sticker, owns_balloon)
postgres-# VALUES(
postgres(# 'cxd70e445647f50560d495d695b7becd3e88083222',
postgres(# 'hxfcba5ec13ba9791dcb52de1f8e25ae7625762222',
postgres(# 1,
postgres(# 1
postgres(# );
INSERT 0 1
postgres=# select * from owners;
contract_address | owner_address | owns_sticker | owns_balloon
--------------------------------------------+--------------------------------------------+--------------+--------------
cxd70e445647f50560d495d695b7becd3e88083222 | hxfcba5ec13ba9791dcb52de1f8e25ae7625762222 | 1 | 1
(1 row)
postgres=# INSERT INTO owners (contract_address, owner_address, owns_sticker, owns_balloon)
postgres-# VALUES(
postgres(# 'cxd70e445647f50560d495d695b7becd3e88083222',
postgres(# 'hxfcba5ec13ba9791dcb52de1f8e25ae7625762222',
postgres(# 1,
postgres(# 1
postgres(# ) ON CONFLICT (contract_address)
postgres-# DO UPDATE owners SET owns_sticker = 0, owns_balloon = 0 WHERE contract_address =
postgres-# 'cxd70e445647f50560d495d695b7becd3e88083222';
ERROR: syntax error at or near "owners"
LINE 8: DO UPDATE owners SET owns_sticker = 0, owns_balloon = 0 WHER...
^
postgres=# INSERT INTO owners (contract_address, owner_address, owns_sticker, owns_balloon)
VALUES(
'cxd70e445647f50560d495d695b7becd3e88083222',
'hxfcba5ec13ba9791dcb52de1f8e25ae7625762222',
1,
1
) ON CONFLICT (contract_address)
DO UPDATE owners SET owns_sticker = 0, owns_balloon = 0;
ERROR: syntax error at or near "owners"
LINE 8: DO UPDATE owners SET owns_sticker = 0, owns_balloon = 0;
And here is the fix:
postgres=# INSERT INTO owners (contract_address, owner_address, owns_sticker, owns_balloon)
VALUES(
'cxd70e445647f50560d495d695b7becd3e88083222',
'hxfcba5ec13ba9791dcb52de1f8e25ae7625762222',
1,
1
) ON CONFLICT (contract_address)
DO UPDATE SET owns_sticker = 0, owns_balloon = 0;
INSERT 0 1
postgres=#
do updatepart. It should beDO UPDATE SET owns_sticker = ...