{"id":16445201,"url":"https://github.com/dgapitts/vagrant-postgres12","last_synced_at":"2025-10-11T16:12:49.864Z","repository":{"id":145829558,"uuid":"326482356","full_name":"dgapitts/vagrant-postgres12","owner":"dgapitts","description":"vagrant automated build of postgres12 with centos7","archived":false,"fork":false,"pushed_at":"2022-01-29T22:37:35.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-04T16:17:09.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgapitts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-03T19:13:45.000Z","updated_at":"2022-01-29T22:37:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"f19ee44c-4359-4a33-aa9b-247bb2b5fd41","html_url":"https://github.com/dgapitts/vagrant-postgres12","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dgapitts/vagrant-postgres12","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-postgres12","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-postgres12/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-postgres12/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-postgres12/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgapitts","download_url":"https://codeload.github.com/dgapitts/vagrant-postgres12/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-postgres12/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007785,"owners_count":26084364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T09:43:38.628Z","updated_at":"2025-10-11T16:12:49.835Z","avatar_url":"https://github.com/dgapitts.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Quick Intro\n\nThis project is a pg12/centos-7 version of vagrant-postgres10 (also centos 7)\nPlease see https://github.com/dgapitts/vagrant-postgres10 for more details.\n\nI have highlighted some of the key setup processes below.\n\nAlso my wiki page [https://wiki.ebabel.eu/index.php?title=Postgres_pgbench_demo_with_IO_intense_background_task] shows how to run concurrent tests (as vagrant and bench1 users) \n\n### Extra manual steps for root sar crontab \n\n```\n# run system activity accounting tool every 1 minutes\n*/1 * * * * /usr/lib64/sa/sa1 1 1\n# generate a daily summary of process accounting at 23:53\n53 23 * * * /usr/lib64/sa/sa2 -A\n```\n### systemctl commands for postgresql-12.service for status/start/stop with alias' for vagrant user\n\nThese can be run as the standard vagrant user\n```\n[pg12centos7:vagrant:~] # alias pgstatus='echo \"sudo systemctl status postgresql-12.service\";sudo systemctl status postgresql-12.service'\n[pg12centos7:vagrant:~] # alias pgstart='echo \"sudo systemctl start postgresql-12.service\";sudo systemctl start postgresql-12.service'\n[pg12centos7:vagrant:~] # alias pgstop='echo \"sudo systemctl stop postgresql-12.service\";sudo systemctl stop postgresql-12.service'\n```\nand running this:\n```\n[pg12centos7:vagrant:~] # pgstatus \nsudo systemctl status postgresql-12.service\n● postgresql-12.service - PostgreSQL 12 database server\n   Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; vendor preset: disabled)\n   Active: active (running) since do 2021-01-07 17:18:16 UTC; 14h ago\n     Docs: https://www.postgresql.org/docs/12/static/\n Main PID: 16823 (postmaster)\n   CGroup: /system.slice/postgresql-12.service\n           ├─16823 /usr/pgsql-12/bin/postmaster -D /var/lib/pgsql/12/data/\n           ├─16825 postgres: logger   \n           ├─16827 postgres: checkpointer   \n           ├─16828 postgres: background writer   \n           ├─16829 postgres: walwriter   \n           ├─16830 postgres: autovacuum launcher   \n           ├─16831 postgres: stats collector   \n           └─16832 postgres: logical replication launcher   \n\njan 07 17:18:15 pg12centos7 systemd[1]: Starting PostgreSQL 12 database server...\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.034 UTC [16823] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, com..., 64-bit\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.038 UTC [16823] LOG:  listening on IPv6 address \"::1\", port 5432\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.038 UTC [16823] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.039 UTC [16823] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.041 UTC [16823] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.051 UTC [16823] LOG:  redirecting log output to logging collector process\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.051 UTC [16823] HINT:  Future log output will appear in directory \"log\".\njan 07 17:18:16 pg12centos7 systemd[1]: Started PostgreSQL 12 database server.\nHint: Some lines were ellipsized, use -l to show in full.\n\n[pg12centos7:vagrant:~] # pgstop\nsudo systemctl stop postgresql-12.service\n[pg12centos7:vagrant:~] # pgstatus \nsudo systemctl status postgresql-12.service\n● postgresql-12.service - PostgreSQL 12 database server\n   Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; vendor preset: disabled)\n   Active: inactive (dead) since vr 2021-01-08 20:32:02 UTC; 7s ago\n     Docs: https://www.postgresql.org/docs/12/static/\n  Process: 16823 ExecStart=/usr/pgsql-12/bin/postmaster -D ${PGDATA} (code=exited, status=0/SUCCESS)\n Main PID: 16823 (code=exited, status=0/SUCCESS)\n\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.034 UTC [16823] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, com..., 64-bit\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.038 UTC [16823] LOG:  listening on IPv6 address \"::1\", port 5432\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.038 UTC [16823] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.039 UTC [16823] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.041 UTC [16823] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.051 UTC [16823] LOG:  redirecting log output to logging collector process\njan 07 17:18:16 pg12centos7 postmaster[16823]: 2021-01-07 17:18:16.051 UTC [16823] HINT:  Future log output will appear in directory \"log\".\njan 07 17:18:16 pg12centos7 systemd[1]: Started PostgreSQL 12 database server.\njan 08 20:32:02 pg12centos7 systemd[1]: Stopping PostgreSQL 12 database server...\njan 08 20:32:02 pg12centos7 systemd[1]: Stopped PostgreSQL 12 database server.\nHint: Some lines were ellipsized, use -l to show in full.\n[pg12centos7:vagrant:~] # pgstart\nsudo systemctl  start postgresql-12.service\n[pg12centos7:vagrant:~] # pgstatus \nsudo systemctl status postgresql-12.service\n● postgresql-12.service - PostgreSQL 12 database server\n   Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; vendor preset: disabled)\n   Active: active (running) since vr 2021-01-08 20:32:23 UTC; 4s ago\n     Docs: https://www.postgresql.org/docs/12/static/\n  Process: 32672 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)\n Main PID: 32677 (postmaster)\n   CGroup: /system.slice/postgresql-12.service\n           ├─32677 /usr/pgsql-12/bin/postmaster -D /var/lib/pgsql/12/data/\n           ├─32679 postgres: logger   \n           ├─32681 postgres: checkpointer   \n           ├─32682 postgres: background writer   \n           ├─32683 postgres: walwriter   \n           ├─32684 postgres: autovacuum launcher   \n           ├─32685 postgres: stats collector   \n           └─32686 postgres: logical replication launcher   \n\njan 08 20:32:23 pg12centos7 systemd[1]: Starting PostgreSQL 12 database server...\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.205 UTC [32677] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, com..., 64-bit\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.208 UTC [32677] LOG:  listening on IPv6 address \"::1\", port 5432\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.208 UTC [32677] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.212 UTC [32677] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.214 UTC [32677] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.224 UTC [32677] LOG:  redirecting log output to logging collector process\njan 08 20:32:23 pg12centos7 postmaster[32677]: 2021-01-08 20:32:23.224 UTC [32677] HINT:  Future log output will appear in directory \"log\".\njan 08 20:32:23 pg12centos7 systemd[1]: Started PostgreSQL 12 database server.\nHint: Some lines were ellipsized, use -l to show in full.\n```\n\n\n### pg_ctl to reload/status/start/stop/restart postgresql-12.service as postgres user\n\nThis should be run as the postgres user\n```\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ status\npg_ctl: server is running (PID: 16401)\n/usr/pgsql-12/bin/postgres \"-D\" \"/var/lib/pgsql/12/data/\"\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ reload\nserver signaled\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ status\npg_ctl: server is running (PID: 16401)\n```\n\nThe reload operation picks up new .conf setting but as above we are still running on the same PID.\n\nNext with a stop and then start, the postmaster (the postgres master) is on a new PID:\n```\n/usr/pgsql-12/bin/postgres \"-D\" \"/var/lib/pgsql/12/data/\"\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ stop\nwaiting for server to shut down.... done\nserver stopped\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ start\nwaiting for server to start....2021-01-09 09:14:58.562 UTC [28968] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit\n2021-01-09 09:14:58.566 UTC [28968] LOG:  listening on IPv6 address \"::1\", port 5432\n2021-01-09 09:14:58.566 UTC [28968] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\n2021-01-09 09:14:58.569 UTC [28968] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\n2021-01-09 09:14:58.573 UTC [28968] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\n2021-01-09 09:14:58.590 UTC [28968] LOG:  redirecting log output to logging collector process\n2021-01-09 09:14:58.590 UTC [28968] HINT:  Future log output will appear in directory \"log\".\n done\nserver started\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ status\npg_ctl: server is running (PID: 28968)\n/usr/pgsql-12/bin/postgres \"-D\" \"/var/lib/pgsql/12/data\"\n```\nthere is a restart option runs back-to-back stop and start commands\n\n```\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ restart\nwaiting for server to shut down.... done\nserver stopped\nwaiting for server to start....2021-01-09 09:19:13.980 UTC [28987] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit\n2021-01-09 09:19:13.982 UTC [28987] LOG:  listening on IPv6 address \"::1\", port 5432\n2021-01-09 09:19:13.982 UTC [28987] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\n2021-01-09 09:19:13.984 UTC [28987] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\n2021-01-09 09:19:13.986 UTC [28987] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\n2021-01-09 09:19:14.001 UTC [28987] LOG:  redirecting log output to logging collector process\n2021-01-09 09:19:14.001 UTC [28987] HINT:  Future log output will appear in directory \"log\".\n done\nserver started\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ status\npg_ctl: server is running (PID: 28987)\n/usr/pgsql-12/bin/postgres \"-D\" \"/var/lib/pgsql/12/data\"\n[pg12centos7:postgres:~] # ps -ef|grep 28987\npostgres 28987     1  0 09:19 ?        00:00:00 /usr/pgsql-12/bin/postgres -D /var/lib/pgsql/12/data\npostgres 28988 28987  0 09:19 ?        00:00:00 postgres: logger\npostgres 28990 28987  0 09:19 ?        00:00:00 postgres: checkpointer\npostgres 28991 28987  0 09:19 ?        00:00:00 postgres: background writer\npostgres 28992 28987  0 09:19 ?        00:00:00 postgres: walwriter\npostgres 28993 28987  0 09:19 ?        00:00:00 postgres: autovacuum launcher\npostgres 28994 28987  0 09:19 ?        00:00:00 postgres: stats collector\n```\n\n### reviewing pg_ctl shutdown modes \n\nThere are three shutdown modes smart, fast and immediate\n```\n[pg12centos7:postgres:~] # pg_ctl --help | grep -A4 '^Shutdown modes'\nShutdown modes are:\n  smart       quit after all clients have disconnected\n  fast        quit directly, with proper shutdown (default)\n  immediate   quit without complete shutdown; will lead to recovery on restart\n\n```\n\nhere are a few notes, including a comparison to how the same terms are used in oracle but with a significantly different meaning: \n* smart is potentially very slow i.e. politely waiting for all connections to disconn\n* fast (default) is reasonably fast, assuming the db is in a healthy state and cleanly shuts down the db i.e. like an oracle \"shutdown immediate\"\n* immediate this is very fast, but crash recovery is required on the db restart i.e. this is similar to the oracle \"shutdown abort\" and not like an oracle \"shutdown immediate\"\n\n\nFor an idle database these are all loosely equivalent:\n\n```\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ status\npg_ctl: server is running (PID: 1694)\n/usr/pgsql-12/bin/postgres \"-D\" \"/var/lib/pgsql/12/data\"\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ stop immediate\npg_ctl: too many command-line arguments (first is \"stop\")\nTry \"pg_ctl --help\" for more information.\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ stop -m immediate\nwaiting for server to shut down.... done\nserver stopped\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ start\nwaiting for server to start....2021-01-09 16:14:20.392 UTC [1715] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit\n2021-01-09 16:14:20.393 UTC [1715] LOG:  listening on IPv6 address \"::1\", port 5432\n2021-01-09 16:14:20.393 UTC [1715] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\n2021-01-09 16:14:20.396 UTC [1715] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\n2021-01-09 16:14:20.399 UTC [1715] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\n2021-01-09 16:14:20.419 UTC [1715] LOG:  redirecting log output to logging collector process\n2021-01-09 16:14:20.419 UTC [1715] HINT:  Future log output will appear in directory \"log\".\n done\nserver started\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ stop -m fast\nwaiting for server to shut down.... done\nserver stopped\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ start\nwaiting for server to start....2021-01-09 16:15:18.774 UTC [1728] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit\n2021-01-09 16:15:18.774 UTC [1728] LOG:  listening on IPv6 address \"::1\", port 5432\n2021-01-09 16:15:18.775 UTC [1728] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\n2021-01-09 16:15:18.776 UTC [1728] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\n2021-01-09 16:15:18.779 UTC [1728] LOG:  listening on Unix socket \"/tmp/.s.PGSQL.5432\"\n2021-01-09 16:15:18.796 UTC [1728] LOG:  redirecting log output to logging collector process\n2021-01-09 16:15:18.796 UTC [1728] HINT:  Future log output will appear in directory \"log\".\n done\nserver started\n[pg12centos7:postgres:~] # pg_ctl -D /var/lib/pgsql/12/data/ stop -m smart\nwaiting for server to shut down.... done\nserver stopped\n[pg12centos7:postgres:~] # pg_ctl --help | grep -A3 '^Shutdown modes'\nShutdown modes are:\n  smart       quit after all clients have disconnected\n  fast        quit directly, with proper shutdown (default)\n  immediate   quit without complete shutdown; will lead to recovery on restart\n```\n\n\n\n### Manually running quick-start-setup-pg-ora-demo-scripts.sh\n\nFirst let's review this setup script:\n```\n[root@pg12centos7 ~]# cat /vagrant/quick-start-setup-pg-ora-demo-scripts.sh\nsu -c \"cd ~;pwd;git clone https://github.com/dgapitts/pg-ora-demo-scripts.git;ls -l pg-ora-demo-scripts\" -s /bin/sh postgres\ncp /vagrant/quick-start-setup-pg-ora-demo-scripts.sql /tmp/quick-start-setup-pg-ora-demo-scripts.sql\ncp /vagrant/pgpass /tmp/pgpass\nsu -c \"psql postgres -f /tmp/quick-start-setup-pg-ora-demo-scripts.sql\" -s /bin/sh postgres\nsu -c \"cat /tmp/pgpass \u003e\u003e ~/.pgpass\" -s /bin/sh postgres\nsu -c \"chmod 600 ~/.pgpass\" -s /bin/sh postgres\ncp /vagrant/bashrc.append.txt /tmp/bashrc.append.txt\nsu -c \"cat /tmp/bashrc.append.txt \u003e\u003e ~/.bash_profile\" -s /bin/sh postgres\n```\n\nNow stepping through manually, first you need to setup an ssh-key for the postgres user and upload it to github:\n\n```\ncd ~\nssh-keygen\ncat ~/.ssh/id_rsa.pub\n\u003c\u003c copy results into your https://github.com/settings/profile - SSH \u003e\u003e\n```\n\ni.e. as per https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent\n\t\n\nNext as root \n\n```\n[root@pg12centos7 ~]# su -c \"cd ~;pwd;git clone https://github.com/dgapitts/pg-ora-demo-scripts.git;ls -l pg-ora-demo-scripts\" -s /bin/sh postgres\n/var/lib/pgsql\nCloning into 'pg-ora-demo-scripts'...\nremote: Enumerating objects: 97, done.\nremote: Counting objects: 100% (97/97), done.\nremote: Compressing objects: 100% (80/80), done.\nremote: Total 249 (delta 33), reused 61 (delta 15), pack-reused 152\nReceiving objects: 100% (249/249), 1.15 MiB | 1.47 MiB/s, done.\nResolving deltas: 100% (85/85), done.\ntotal 40\ndrwxr-xr-x. 5 postgres postgres    44 Mar  9 12:57 demo\n-rw-r--r--. 1 postgres postgres 35147 Mar  9 12:57 LICENSE\ndrwxr-xr-x. 6 postgres postgres   247 Mar  9 12:57 loadtest\ndrwxr-xr-x. 6 postgres postgres   100 Mar  9 12:57 memtest\ndrwxr-xr-x. 2 postgres postgres    72 Mar  9 12:57 oramon\ndrwxr-xr-x. 2 postgres postgres   199 Mar  9 12:57 pgmon\n-rw-r--r--. 1 postgres postgres  1441 Mar  9 12:57 README.md\n[root@pg12centos7 ~]# cp /vagrant/quick-start-setup-pg-ora-demo-scripts.sql /tmp/quick-start-setup-pg-ora-\n[root@pg12centos7 ~]# cp /vagrant/pgpass /tmp/pgpass\n[root@pg12centos7 ~]# cat /tmp/quick-start-setup-pg-ora-demo-scripts.sql\nalter user postgres with password 'changeme';\n\nCREATE DATABASE bench1;\n\\c bench1\ncreate user bench1 with password 'changeme';\nGRANT ALL PRIVILEGES ON DATABASE bench1 to bench1;\n\n[root@pg12centos7 ~]# su -c \"psql postgres -f /tmp/quick-start-setup-pg-ora-demo-scripts.sql\" -s /bin/sh postgres\ncould not change directory to \"/root\": Permission denied\nALTER ROLE\nCREATE DATABASE\nYou are now connected to database \"bench1\" as user \"postgres\".\nCREATE ROLE\nGRANT\n[root@pg12centos7 ~]# su -c \"cat /tmp/pgpass \u003e\u003e ~/.pgpass\" -s /bin/sh postgres\n[root@pg12centos7 ~]# su -c \"chmod 600 ~/.pgpass\" -s /bin/sh postgres\n```\n\nNB1 Currently I can read but not execute the \n\n```\n[pg12centos7:postgres:~] # ls -ltr /vagrant/*.sh\n-rw-r--r--. 1 vagrant vagrant  191 Mar  8 22:58 /vagrant/update_alluser_passwords_from_changeme.sh\n-rwxr-xr-x. 1 vagrant vagrant  454 Mar  8 22:58 /vagrant/quick-start-setup-pg-ora-demo-scripts.sh\n-rwxr-xr-x. 1 vagrant vagrant  555 Mar  8 22:58 /vagrant/developer-option-part2-setup-pg-ora-demo-scripts-run-as-postgres.sh\n-rwxrwxrwx. 1 vagrant vagrant 2100 Mar  8 22:58 /vagrant/developer-option-part1-postgres-user-keygen-run-as-vagrant.sh\n-rw-r--r--. 1 vagrant vagrant 2966 Mar  9 12:24 /vagrant/provision.sh\n```\n\ninterim solution to copy this local\n```\n-bash: /vagrant/update_alluser_passwords_from_changeme.sh: Permission denied\n[pg12centos7:postgres:~] # cp /vagrant/update_alluser_passwords_from_changeme.* .\n[pg12centos7:postgres:~] # ./update_alluser_passwords_from_changeme.sh ujMDgPM4qGmfRUe9Bm7Qv6x7wduaBp\nALTER ROLE\n```\n\nafter running update password, switch the pg_hba.conf by running the following\n\n```\ncp /vagrant/pg_hba.conf /tmp/pg_hba.conf\nsu -c \"cp -p /var/lib/pgsql/12/data/pg_hba.conf /var/lib/pgsql/10/data/pg_hba.conf.`date '+%Y%m%d-%H%M'`.bak\" -s /bin/sh postgres\nsu -c \"cat /tmp/pg_hba.conf \u003e /var/lib/pgsql/10/data/pg_hba.conf\" -s /bin/sh postgres\nsystemctl stop postgresql-12.service\nsystemctl start postgresql-12.service\n```\n\n### Running pgbench to show the affect expensive background (OLAP) tasks\n\nFor some time I've been wondering about the impact of expensive background (OLAP) tasks (taking 1000) on standard OLTP short queries (taking 1 or 2 ms):\n\n* the background tasks are clearly using CPU and IO in themselves\n* but also this may flush the shared_buffers and so slow down other regular OLTP\n* are these background tasks going to be even more expensive with pg12 which parallelization enabled by default\n\nFor more details please see my wiki page analysis:\nhttps://wiki.ebabel.eu/index.php?title=Postgres_pgbench_demo_with_IO_intense_background_task\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgapitts%2Fvagrant-postgres12","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgapitts%2Fvagrant-postgres12","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgapitts%2Fvagrant-postgres12/lists"}