Improve CREATE/DROP/RENAME DATABASE so that when failing because the source
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 Aug 2008 18:03:46 +0000 (18:03 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 Aug 2008 18:03:46 +0000 (18:03 +0000)
commit4abd7b49f1e9eb1ccc934be5efabb6fd531d0141
treeeaaf616050587b0d8f48c238316ff42fadd6e244
parentec73b56a31fd0933280e85cd4e7b17c45c2ccbed
Improve CREATE/DROP/RENAME DATABASE so that when failing because the source
or target database is being accessed by other users, it tells you whether
the "other users" are live sessions or uncommitted prepared transactions.
(Indeed, it tells you exactly how many of each, but that's mostly just
because it was easy to do so.)  This should help forestall the gotcha of
not realizing that a prepared transaction is what's blocking the command.
Per discussion.
src/backend/commands/dbcommands.c
src/backend/storage/ipc/procarray.c
src/include/storage/procarray.h