There is no DECLARE TEMP CURSOR or DECLARE TEMP variable in PLpgSQL and
sure .. DECLARE TEMP has no sense, I talked about similarity DECLARE and CREATE TEMP
CREATE TEMP TABLE has a different meaning from what I understand you envision for variables.
But maybe I'm mistaken. Your original post did not describe the entire syntax: CREATE [TEMP] VARIABLE [IF NOT EXISTS] name AS type [ DEFAULT expression ] [[NOT] NULL] [ ON TRANSACTION END { RESET | DROP } ] [ { VOLATILE | STABLE } ];
Especially the TEMP is not spelled out and how its presence affects or doesn't ON TRANSACTION END. So may be if you elaborate I understand where you are coming from.
TEMP has same functionality (and implementation) like our temp tables - so at session end the temp variables are destroyed, but it can be assigned to transaction.