In-memory table in PostgreSQL

PHPst picture PHPst · Oct 16, 2011 · Viewed 10.1k times · Source

How can I create an in-memory table in PostgreSQL?

Answer

Andrew Lazarus picture Andrew Lazarus · Oct 20, 2011

Create a RAM disk using software appropriate to your OS. Use CREATE TABLESPACE to create a DB cluster on the RAM disk. When you create your table, use the TABLESPACE clause. Obviously, your RAM tables will not persist across system reboots unless you save the RAM disk.