团队:
最近我将 12.1.0 数据库升级到 19c(非 CDB 架构)。当前兼容性设置为 12.2.0。我可以将其降级到早期版本 - 12.1.0 吗?文档说明降级是可能的,但不确定兼容性参数。
团队:
最近我将 12.1.0 数据库升级到 19c(非 CDB 架构)。当前兼容性设置为 12.2.0。我可以将其降级到早期版本 - 12.1.0 吗?文档说明降级是可能的,但不确定兼容性参数。
wal_level 在 postgresql.conf 中有注释,我也没有在 auto.conf 中看到任何条目。但在数据库级别,我看到它设置为 REPLICA。还有其他地方可以设置吗?
postgres@postgresqlmaster:/etc/postgresql/12/data$ psql -p 5433
psql (12.3 (Ubuntu 12.3-1.pgdg18.04+1))
Type "help" for help.
postgres=# select name, setting, sourcefile, sourceline from pg_settings where name = 'wal_level';
name | setting | sourcefile | sourceline
-----------+---------+------------+------------
wal_level | replica | |
(1 row)
postgres@postgresqlmaster:/etc/postgresql/12/data$ cat /var/lib/postgresql/12/data/postgresql.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
listen_addresses = '*'
shared_buffers = '200MB'
synchronous_standby_names = 'pgstandby_synch1'
我正在设置一个主从架构,到目前为止已经完成了以下步骤:
在主人:
CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD 'replicator';
theowl@postgresql:/etc/postgresql/12/main$ sudo vi pg_hba.conf
host replication replicator 192.168.56.8/24 md5
sudo systemctl restart postgresql
随时待命:
theowl@postgresql:/etc/postgresql/12/main$ sudo systemctl stop postgresql
postgres@postgresql:/etc/postgresql/12/main$ ls -ltr
total 0
pg_basebackup -h 192.168.56.7 -U replicator -p 5432 -D /etc/postgresql/12/main/ -Fp -Xs -P -R
postgres@postgresql:/etc/postgresql/12/main$ pg_basebackup -h 192.168.56.7 -U replicator -p 5432 -D /etc/postgresql/12/main/ -Fp -Xs -P -R
Password:
48423/48423 kB (100%), 1/1 tablespace
postgres@postgresql:/etc/postgresql/12/main$ ls -ltr
total 80
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_xact
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_twophase
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_stat_tmp
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_stat
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_snapshots
drwx------ 4 postgres postgres 4096 Mar 12 16:35 pg_multixact
-rw------- 1 postgres postgres 224 Mar 12 16:35 backup_label
drwx------ 3 postgres postgres 4096 Mar 12 16:35 pg_wal
drwx------ 8 postgres postgres 4096 Mar 12 16:35 base
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_subtrans
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_replslot
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_notify
-rw------- 1 postgres postgres 3 Mar 12 16:35 PG_VERSION
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_tblspc
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_serial
drwx------ 4 postgres postgres 4096 Mar 12 16:35 pg_logical
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_dynshmem
drwx------ 2 postgres postgres 4096 Mar 12 16:35 pg_commit_ts
drwx------ 2 postgres postgres 4096 Mar 12 16:35 global
-rw------- 1 postgres postgres 0 Mar 12 16:35 standby.signal
-rw------- 1 postgres postgres 268 Mar 12 16:35 postgresql.auto.conf
postgres@postgresql:/etc/postgresql/12/main$ cat postgresql.auto.conf
primary_conninfo = 'user=replicator password=replicator host=192.168.56.7 port=5432 sslmode=prefer sslcompression=0 gssencmode=prefer krbsrvname=postgres target_session_attrs=any'
postgres@postgresql:/etc/postgresql/12/main$ source ~/.pgsql_profile
postgres@postgresql:/etc/postgresql/12/main$ pg_ctl -D /etc/postgresql/12/main/ start
***waiting for server to start....postgres: could not access the server configuration file "/etc/postgresql/12/main/postgresql.conf": No such file or directory
stopped waiting
pg_ctl: could not start server
Examine the log output.***
postgres@postgresql:/etc/postgresql/12/main$ cat ~/.pgsql_profile
export PATH=/usr/lib/postgresql/12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin PAGER=less