AI prompts
base on Backup and restore management tool for PostgreSQL pg_rman
=======
pg_rman is an online backup and restore tool for PostgreSQL.
The goal of the pg_rman project is to provide a method for online backup
and PITR that is as easy as pg_dump. Also, it maintains a backup catalog
per database cluster. Users can maintain old backups including archive
logs with one command.
Branches
--------
There are several branches within pg_rman repository in order to work with
different PostgreSQL server versions without introducing server version
check code blocks. Please choose a branch to match the PostgreSQL version
you will be building pg_rman against.
* master : branch for PostgreSQL 17 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_16_STABLE : branch for PostgreSQL 16 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_16_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_15_STABLE : branch for PostgreSQL 15 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_15_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_14_STABLE : branch for PostgreSQL 14 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_14_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_13_STABLE : branch for PostgreSQL 13 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_13_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_12_STABLE : branch for PostgreSQL 12 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_12_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_11_STABLE : branch for PostgreSQL 11 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_11_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
How to use
----------
To take an online backup, use the `backup` command:
````
$ pg_rman backup --backup-mode=full --with-serverlog
INFO: copying database files
INFO: copying archived WAL files
INFO: copying server log files
INFO: backup complete
INFO: Please execute 'pg_rman validate' to verify the files are correctly copied.
````
To list all the backups taken so far, use the `show` command:
````
$ pg_rman show
=====================================================================
StartTime EndTime Mode Size TLI Status
=====================================================================
2023-11-28 12:14:03 2023-11-28 12:14:05 FULL 342MB 1 OK
2023-11-28 12:13:56 2023-11-28 12:13:57 ARCH 16MB 1 OK
2023-11-28 12:13:52 2023-11-28 12:13:53 ARCH 16MB 1 OK
2023-11-28 12:13:24 2023-11-28 12:13:26 FULL 375MB 1 OK
2023-11-28 12:13:15 2023-11-28 12:13:17 INCR 33MB 1 OK
2023-11-28 12:12:48 2023-11-28 12:12:50 INCR 33MB 1 OK
2023-11-28 12:12:36 2023-11-28 12:12:38 INCR 33MB 1 OK
2023-11-28 12:11:51 2023-11-28 12:12:00 FULL 3366MB 1 OK
````
To restore from a backup, use the `restore` command. Up to PostgreSQL11, note that pg_rman itself generates the `recovery.conf` file required to perform PostgreSQL PITR.
````
$ pg_ctl stop -m immediate
$ pg_rman restore
$ cat data/recovery.signal
# recovery.signal generated by pg_rman 1.3.16
$ cat data/pg_rman_recovery.conf
# added by pg_rman 1.3.16
restore_command = 'cp /home/postgres/arclog/%f %p'
recovery_target_timeline = '1'
$ pg_ctl start
````
After to PostgreSQL12, note that pg_rman itself added PostgreSQL PITR related options to `postgresql.conf` file and generates the `recovery.signal` file in $PGDATA.
To see more options to use with each command, run `pg_rman --help`.
Also, see the documentation for detailed usage:
http://ossc-db.github.io/pg_rman/index.html
How to build and install from source code
-----------------------------------------
Go to the top directory of pg_rman source tree and run the following commands:
````
$ make
# make install
````
The following packages need to be installed as a prerequisite.
* zlib-devel
How to run regression tests
---------------------------
Start PostgreSQL server and run the below command.
````
$ make installcheck
````
", Assign "at most 3 tags" to the expected json: {"id":"6806","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"