1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Rough script to add tables to the user guide for performance tests.

This really needs to be worked on but for now at least preserve to code to be improved later.
This commit is contained in:
David Steele 2020-03-25 19:00:09 -04:00
parent 10b4b9af87
commit d242114dc0

View File

@ -221,6 +221,26 @@
<variable key="pg-cluster-check-upgrade" if="{[os-type-is-centos6]}">service postgresql-{[pg-version-upgrade]} status</variable>
<variable key="pg-cluster-check-upgrade" if="{[os-type-is-centos7]}">systemctl status postgresql-{[pg-version-upgrade]}.service</variable>
<!-- Add more tables to make the backup more interesting. This is a rough and ready solution that can be pasted into the
document where needed to grow the number of files as needed for performance testing. -->
<!-- <execute user="postgres" show="n">
<exe-cmd>psql -c "
create or replace function create_test_table(prefix int, scale int) returns void as \$\$
declare
index int;
begin
for index in 1 .. scale loop
execute 'create table test_' || prefix || '_' || index || ' (id int)';
end loop;
end \$\$ LANGUAGE plpgsql;"</exe-cmd>
</execute>
<execute user="postgres" show="n">
<exe-cmd>
bash -c 'for i in {1..100}; do psql -c "select create_test_table(${i?}, 1000)"; done'
</exe-cmd>
</execute> -->
<!-- Common commands -->
<variable key="ssh-key-install">
mkdir -p -m 700 /root/.ssh &amp;&amp; \