postgres=# d test
Table "public.test"
Column | Type | Collation | Nullable | Default
--------+-----------------------+-----------+----------+---------
id | integer | | |
name | character varying(20) | | |
postgres=# SELECT attname FROM pg_attribute where attrelid='test'::regclass and attname not in ('cmax','cmin','ctid', 'xmax','xmin','tableoid');
attname
---------
id
name
(2 rows)