Skip to main content

Steps to setup pg_partman

Steps to setup partman

** Make sure you don't have the postgres service running on windows **

Use WSL Ubuntu :

  • It may need some additional setup (enable virtualization, etc)

Install postgresql on ubuntu:

Login and setup postgres and postgres user:

  1. Run the psql command from the postgres user account
    • sudo -u postgres psql postgres
  2. Set the password
    • \password postgres
  3. Enter a new password (pass@word1)
  4. Close psql
    • \q

Run the following commands:

`sudo apt install make`
`sudo apt install gcc`
`sudo apt install postgresql-server-dev-13` (if the version ever changes, change that number at the end)

Setting up partman:

Commands that may come in handy:

`sudo service postgresql start` (starts postgres service)
`sudo service postgresql restart` (restarts postgres service)
`sudo service postgresql stop` (stops postgres service)
`explorer.exe .` ( Use this if you fancy an explorer view instead of a terminal one.  Also allows you to edit the files without using vim)

To get PgAdmin working:

Inside of the pg_hba.conf file, change the local connection to
	`host    all             all             0.0.0.0/0            md5`
Inside of postgres.conf change listen_addresses under CONNECTIONS AND AUTHENTICATION to 
	`listen_addresses = '*'`

Example docs to get partman setup:


Additional Info

https://github.com/pgpartman/pg_partman/blob/master/doc/pg_partman.md 

Partition types that pg_partman supports

  • Time based
  • Integer based

Peformance with 1 billion entries

Saved in the SPIKE: