SELECT b.relname AS table, a.attname AS column
FROM pg_attribute a, pg_class b
WHERE b.relfilenode=a.attrelid
AND a.attname NOT IN ('tableoid','cmax','xmax','cmin','xmin','ctid');