Rename the primary key index when renaming a table in pg

Backport of dcc143cd702bfbfef9cb92e1fde75171d088a5ac

Fixes #12856
Closes #14088