public inbox for [email protected]
help / color / mirror / Atom feedFrom: PG Doc comments form <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Section I - 2.9: Use SELECT to confirm set of rows before DELETE
Date: Mon, 06 Jun 2022 21:19:17 +0000
Message-ID: <[email protected]> (raw)
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/tutorial-delete.html
Description:
Since this tutorial section is coined at beginners, I think it could be
useful to tip users about the possibility to use a SELECT statement with the
exact same qualification(s) as the DELETE statement they're planning to run
to see which rows are about to be deleted, to avoid unintended deletion of
rows. I suggest something like this:
...
Without a qualification, DELETE will remove all rows from the given table,
leaving it empty. The system will not request confirmation before doing
this!
You can check which rows will be deleted by any DELETE statement on the
form:
```DELETE FROM tablename ... <qualificaton> ...```
by rewriting it into a corresponding SELECT statement:
```SELECT * FROM tablename ... <qualification> ...```
This is my first attempt at contributing to the community, so please be
nice. :)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Section I - 2.9: Use SELECT to confirm set of rows before DELETE
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox