sorkin2
Joined 10 years ago
Karma
19
Submissions
11
Member since
Sep 14
Joined 10 years ago
Your example is fundamentally different from parameters sent by a client in a parameterized query, i.e. $1, $2, etc. Also while your flawed example will never use a partial index, parameterized queries can and often will do that. With prepared statements (which are a slightly different concept from parameterized queries) the devil will lie in the details, but even those don't really prevent partial indexes from being used since postgres version 9.2, released years ago.
Have you heard of pg_rewind? https://www.postgresql.org/docs/current/static/app-pgrewind....
From the article I got the impression that both tables were being written to in the same database transaction, so this is not a possible failure scenario at all.