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:
- Follow these steps
- make sure you update it to the latest version (currently 13)
Login and setup postgres and postgres user:
- Run the psql command from the postgres user account
sudo -u postgres psql postgres
- Set the password
\password postgres
- Enter a new password (pass@word1)
- 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:
- In your working folder run:
- git clone https://github.com/keithf4/pg_partman
- cd pg_partman
- make install
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:
No Comments