OpenBSD上的PostgreSQL:12â€13‮
#postgres #database #迁移 #openbsd

-

OpenBSDâ6.8â6.96.9â‮ â·阿比亚克(PostgreSQL)5 °¼ ® è¼â¾sth:

$ nvim -R /usr/local/share/doc/pkg-readmes/postgresql-server

本記事とは別の方法もありますãkoude1âstument 1/4 |

-

$ doas rcctl check postgresql
postgresql(ok)

koude2

$ doas su _postgresql -c "cd /var/postgresql \
    && pg_dumpall -U postgres > /var/postgresql/full.sqldump.bkYYMMDD"
$ # pg superuser's password is required times of the number of tables
2000ö11°°°“ ymmmdd”ã°®°°â£°°¢â¢â¢â€¢â€¥×$ $׫«⁄«⁄«函数 - ·美°°°°d°d°âo»»»»»»»

§

$ doas rcctl stop postgresql
postgresql(ok)
$ # check the server is stopped
$ doas rcctl check postgresql
postgresql(failed)

ãµ¼¼ -

$ doas pkg_add -ui postgresql-server
$ # updated

/var/postgresql/dataâ€

$ doas mv /var/postgresql/data /var/postgresql/data-12
$ doas su _postgresql -c "mkdir /var/postgresql/data"

koude5‮

$ # `--locale` option here can be omitted
$ doas su _postgresql -c "cd /var/postgresql && \
    initdb -D /var/postgresql/data -U postgres -A scram-sha-256 -E UTF8 -W \
        --locale=xx_XX.UTF-8"
$ # pg superuser's password is required

to,to'aâ€â€âµ µ” µ” µ

$ # in case of using tls/ssl connection
$ # - set `listen_addresses` and `ssl` option
$ doas nvim "/var/postgresql/data/postgresql.conf"
$ # - add `hostssl` authentication
$ doas nvim "/var/postgresql/data/pg_hba.conf"
$ # - create certificate if not exists
$ doas su _postgresql -c \
    "cp /var/postgresql/data-12/server.{crt,key} /var/postgresql/data/"

婴儿°°°°こちらの記事â««Å°°¥°°ááá之间。


æ°â£ª >

$ doas rcctl start postgresql
postgresql(ok)
$ # check the server is started and running
$ doas rcctl check postgresql
postgresql(ok)

§ - ª

$ doas su _postgresql -c "cd /var/postgresql && \
    psql -U postgres < /var/postgresql/full.sqldump.bkYYMMDD"
$ # restored

Å®äââað