How to view tuples changed in a PostgreSQL transaction? BEGIN;

   INSERT INTO foo_table(foo_column) VALUES('a'),('b'),('c');

   -- SELECT * FROM pg_stat_activity WHERE ...
   -- shows records with a flag if they have been added/deleted/updated

END;


Is there a way to view the uncommitted inserts/deletes of a transaction for a given table in PostgreSQL 9.x? This is purely for visual confirmation.

While my initial thought is no (just perform a SQL-Select of the table), certain users wanted to visualize differences within the transaction.  I could see how this might be helpful if having a lot of savepoints and transactions. Thus, it was worth asking to the community at large.
You can inspect the internal xmin to identify newly inserted row versions (note, that includes results from UPDATE):
SELECT * FROM foo_table
WHERE  xmin::text = (txid_current() % (2^32)::bigint)::text;

How so?
The function txid_current() returns the current transaction ID. However, while the internal transaction ID type in xmin is 32 bits wide and wraps around every 4 billion transactions,  txid_current() returns a bigint quantity, per documentation:

that is extended with an &quot;epoch&quot; counter so it will not wrap around during the life of an installation.

There is a thread on pgsql-hackers with Tom Lane discussing it.
I derived the safe WHERE condition from it.
Addressing comment: Deleted rows that were deleted in the same transaction are always invisible either way, so not included in the result.
Disclaimer
However, this does not work with subtransactions started with SAVEPOINT (or some other way, plpython can use subtransactions, too). Those spawn separate xids and there is currently no way to get the full list of xids belonging to the top transaction returned by txid_current(). In my search for a solution I found this closely related thread on pgsql-hackers:

Re: rows modified in current transaction

I don't currently see a reliable solution working around that limitation.
Related:

Can I select data inserted in the same uncommited transaction?