Answer the question
In order to leave comments, you need to log in
How to remove a row from the database on update to avoid conflict?
Actually I have a table which consists of fields
UPDATE microservices_transports
SET
transport_id = :next,
username = :username,
password = :password,
is_default = COUNT((SELECT *
FROM
(DELETE FROM microservices_transports AS mt WHERE mt.transport_id = :next AND mt.microservice_id = microservice_id RETURNING *)
WHERE is_default = TRUE
)) > 0
WHERE
transport_id = :prev
Answer the question
In order to leave comments, you need to log in
After FROM there should be a table name, and you have a deletion there that returns *
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question