One of the languages that Postgres offers for writing stored procedures is pl/pgsql. One of it's features is exception block that is used to catch ...
For further actions, you may consider blocking this person and/or reporting abuse
With an exception block PostgreSQL takes a savepoint before in order to rollback when entering the exception block, and savepoints are quite expensive in current versions of PostgreSQL