How to apply PostgreSQL UNLOGGED feature to an existing table?
The following solution is for PostgreSQL versions<=9.4:
You can do:
create unlogged table your_table_alt as
select * from your_table;
Then:
drop table your_table;
alter table your_table_alt rename to your_table;
PostgreSQL 9.5+ allows setting an existing table as LOGGED / UNLOGGED with the ALTER TABLE command... detailed better here.
For e.g.
ALTER TABLE table_test SET LOGGED;
ALTER TABLE table_test SET UNLOGGED;