using psql or a programming language API (such as Perl's DBD::Pg), errors (EXCEPTIONs) lead to a "ROLLBACK TO" the last SAVEPOINT, if any. Using pgAdminIII, EXCEPTIONs cause a (full) ROLLBACK, discarding all uncommitted changes. I used the following sequence of SQL statements and a current version of PostgreSQL (9.4) and pgAdminIII.