Commit 0389d8f
committed
fix: wrap user UPDATE in CTE so the postgres command tag doesn't show as a fake id
`UPDATE … RETURNING id` causes psql to emit both the row ids and the protocol-level command tag (`UPDATE 1`) on stdout, even under `-A -t`. The split-by-newline parser counted the command-tag line as an extra match and reported `2 users matched "you@example"` against a single-row update. Wrap the UPDATE in a CTE so the outer query is a SELECT, which `-t` does strip cleanly. The "multiple matches" warning now fires only when there really are multiple rows for that email.1 parent dfb4860 commit 0389d8f
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
0 commit comments