Difference between revisions of "Pg ctl - Single Directory Postgres"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
# Download Binaries | # Download Binaries | ||
- https://www.enterprisedb.com/download-postgresql-binaries | - https://www.enterprisedb.com/download-postgresql-binaries | ||
− | - https:// | + | or source |
+ | - https://www.postgresql.org/ftp/source/v13.3/ | ||
+ | ``` | ||
+ | ./configure | ||
+ | make | ||
+ | su | ||
+ | make install | ||
+ | adduser postgres | ||
+ | mkdir /usr/local/pgsql/data | ||
+ | chown postgres /usr/local/pgsql/data | ||
+ | su - postgres | ||
+ | /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data | ||
+ | /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start | ||
+ | /usr/local/pgsql/bin/createdb test | ||
+ | /usr/local/pgsql/bin/psql test | ||
+ | ``` | ||
+ | |||
# Download and init from binaries on Linux | # Download and init from binaries on Linux |
Revision as of 01:57, 11 July 2021
Download Binaries
- https://www.enterprisedb.com/download-postgresql-binaries or source
- https://www.postgresql.org/ftp/source/v13.3/
./configure make su make install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test
Download and init from binaries on Linux
curl --output pgsql.tar.gz -L https://sbp.enterprisedb.com/getfile.jsp?fileid=1257664&_ga=2.131528655.1318609253.1625964422-1196070153.1625964422 tar xf pgsql.tar.gz sudo mkdir /pg2 cp -rp pgsql /pg2/ sudo chown -R postgres:postgres /pg2 cd /pg2 sudo -u postgres pgsql/bin/pg_ctl -D busk init sudo -u postgres pgsql/bin/pg_ctl -D busk -l logfile start -o "-F -p 5434" pgsql/bin/pg_dumpall -U postgres -h 127.0.0.1 -p 5434 pgsql/bin/psql -U postgres -h 127.0.0.1 -p 5434
Run
sudo -u postgres mkdir /pg cd /pg sudo -u postgres /usr/lib/postgresql/12/bin/pg_ctl -D busk init sudo -u postgres /usr/lib/postgresql/12/bin/pg_ctl -D busk -l logfile start -o "-F -p 5433" psql -U postgres -h 127.0.0.1 -p 5433 pg_dumpall -U postgres -h 127.0.0.1 -p 5433