update empl set status = 2 where (id = 2);update empl set status = 2, name='tuk', address='ind', metadata='meta' where (id = 2);
Can someone let me know if there are any advantages of doing #1 over #2 assuming there are no other indices or triggers on the table? Which is generally preferred?
Neither…
You’d write: update empl set status = $1, name = $2, … where id = $N;
Then assign some variables in your code to $1, $2, etc…
By having a parameter for each field one query can deal with changes to any of the data elements.
Postgres Version - 10.17
That doesn’t seem relevant, this is a theory question.
David J.