| From: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
|---|---|
| To: | Salma El-Sayed <salmasayed182003(at)gmail(dot)com> |
| Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Kirk Wolak <wolakk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
| Subject: | Re: PoC: Simplify recovery after dropping a table by LOGGING the restore LSN |
| Date: | 2026-10-16 12:18:38 |
| Message-ID: | 507b292a-cae7-4075-a98f-37ad51ef4dc6@uni-muenster.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 15/10/2026 16:26, Salma El-Sayed wrote:
> But in this exact scenario, didn't the database become invalid?
> postgres=# \c db
> connection to server on socket "/tmp/.s.PGSQL.5435" failed: FATAL:
> cannot connect to invalid database "db"
> HINT: Use DROP DATABASE to drop invalid databases.
>
> The LSN value itself is fine to recover to. The problem is the word
> "dropped," since the drop did not actually complete.
Right, this is how I see it too. Stating that the database was dropped
while it is still there (valid or not) isn't ideal.
On top of what Zsolt pointed out:
== new warning ==
postgres=# drop database db;
ERROR: canceling statement due to statement timeout
WARNING: DROP DATABASE "db" (OID 16393) did not complete; the database
may be left invalid and require DROP DATABASE to be run again
HINT: Files belonging to this database may already have been removed.
To recover data from before this attempt, use recovery_target_lsn =
'0/10276790' with recovery_target_inclusive = false.
This warning is now sent to the client, and I have mixed feelings about
it. If a cancelled drop database should tell the user that the database
was left invalid, that's useful whether or not this GUC is set, and it
belongs in a separate patch, not behind log_object_drops. While I
understand the motivation behind it, I'd argue that it should be logged
only in the server -- the user most likely cannot act on it anyway :)
But it is just my opinion.
Also, the primary message is quite long (two clauses). I recommend
taking a look at the error style guide[1]
Thanks for working on this!
Best, Jim
1 - https://www.postgresql.org/docs/18/error-style-guide.html
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ayush Tiwari | 2026-10-16 12:24:00 | [PATCH] Small gaps in IoWorkerMain() error handling |
| Previous Message | Etsuro Fujita | 2026-10-16 12:10:44 | Re: postgres_fdw: transaction mode inheritance corner cases |