UPDATE Result indication when primary key is not in table?
Closed this issue · 1 comments
Trying to update a table with an id (serial primary key) that does not exist.
Connecting directly to the db returns feedback on success/failure:
# UPDATE public_workspaces set name='JOHN' where id = 5;
UPDATE 0
#UPDATE public_workspaces set name='JOHN' where id = 2;
UPDATE 1
Yet pg returns the same result structure (see below). Is there a way to check if the UPDATE has succeeded?
server_1 | Result {
server_1 | command: 'UPDATE',
server_1 | rowCount: 0,
server_1 | oid: null,
server_1 | rows: [],
server_1 | fields: [],
server_1 | _parsers: undefined,
server_1 | _types: TypeOverrides {
server_1 | _types: {
server_1 | getTypeParser: [Function: getTypeParser],
server_1 | setTypeParser: [Function: setTypeParser],
server_1 | arrayParser: [Object],
server_1 | builtins: [Object]
server_1 | },
server_1 | text: {},
server_1 | binary: {}
server_1 | },
server_1 | RowCtor: null,
server_1 | rowAsArray: false
server_1 | }
(rowCount
)