On 2025-07-16 12:38 a.m., Ray O'Donnell wrote:
On 16 July 2025 08:19:09 Darren Duncan wrote:
I am finding that it is a recurring and damaging source of user error that
Object/Explorer commands named "Delete" actually correspond to SQL DROP rather
than SQL DELETE or TRUNCATE. Multiple times I have accidentally dropped tables
when I meant to just truncate them.
In fairness, you don't (SQL) DELTE tables - you delete their rows, hence the
command is DELETE FROM. And it is intuitive that when you right-click on an
object and click "Delete", it is the object itself which gets zapped. Also,
TRUNCATE is there in the menu too.
Yes, (SQL) DELETE does not remove the table objects themselves, just the rows in
them, hence the problem that users would see "Delete" in the pgAdmin menus and
choose it instinctively thinking that removing just records is what would happen.
While Truncate is also in the menus, it is further down and often missed when
one sees Delete and thinks that's what I want and stops reading further.
Having said that, I recall that the menu used to say "Drop" rather than
"Delete", which IMHO is clearer to SQL-savvy people.... it got changed at some
point.
And SQL-savvy people are the primary user base of pgAdmin I would assume.
Best for this command to line up to avoid confusion of the same term being used
for 2 very different meanings.
Following a renaming to Drop it should be very easy and quick for people to
adapt to.
Those that don't have the cognitive dissonance would still recognize what the
command does.
IMPORTANT: Alphabetically, Drop and Delete are about in the same positions in
each menu, so those wondering where Delete went would see the similar-appearance
Drop in the same place and should infer through English if not SQL that it does
the same thing.
Darren Duncan