Re: Accessing Postgres Server and database from other Machine

Поиск
Список
Период
Сортировка
От Paul Förster
Тема Re: Accessing Postgres Server and database from other Machine
Дата
Msg-id A67CA642-8DE2-4429-8D6C-A22CF035B120@gmail.com
обсуждение исходный текст
Ответ на Re: Accessing Postgres Server and database from other Machine  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Accessing Postgres Server and database from other Machine
Список pgsql-general
Hi Adrian,

> On 04. Dec, 2020, at 16:13, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> That is the wrong file, the *.sample is the giveaway.

hmmm, I'd rather call it essential reference documentation or template for automation. It's perfectly well suited to
automaticallystrip all comments and then diff the result to ones real world postgresql.conf or some other version
postgresql.conffile to find parameters that have been removed or changed with a new PostgreSQL version. This is highly
usefulfor planning migrations and have a quick reference what to check for before actually migrating. So for me this is
muchmore than just a giveaway. 

A simple, but effective (Linux, bash) example:

#!/bin/bash
oldHome=/data/postgres/12.5
newHome=/data/postgres/13.1
# confOld=${oldHome}/share/postgresql.conf.sample
confOld=/data/pg01/cdb01a/db/postgresql.base.conf  # postgresql."base".conf because of Patroni
confNew=${newHome}/share/postgresql.conf.sample
sed -e "s/^#//; s/[[:space:]]*#.*$//; /^--*/d; /^ /d; /^$/d" ${confOld} | sort >/tmp/f1
sed -e "s/^#//; s/[[:space:]]*#.*$//; /^--*/d; /^ /d; /^$/d" ${confNew} | sort >/tmp/f2
diff -y /tmp/f1 /tmp/f2
rm /tmp/f1 /tmp/f2

Cheers,
Paul



Here's some sample output of my (still) 12.5 Patroni/etcd test-and-play-around-cluster run against the new PostgreSQL
13.1sample file: 

archive_command = 'cp %p /data/arch/cdb01a/%f'              |    archive_cleanup_command = ''
archive_mode = on                          |    archive_command = ''
archive_timeout = 1800                          |    archive_mode = off
                                  >    archive_timeout = 0
                                  >    array_nulls = on
                                  >    authentication_timeout = 1min
autovacuum_analyze_scale_factor = 0.1                autovacuum_analyze_scale_factor = 0.1
autovacuum_analyze_threshold = 50                autovacuum_analyze_threshold = 50
autovacuum_freeze_max_age = 200000000                autovacuum_freeze_max_age = 200000000
autovacuum_max_workers = 10                      |    autovacuum_max_workers = 3
autovacuum_multixact_freeze_max_age = 400000000            autovacuum_multixact_freeze_max_age = 400000000
autovacuum_naptime = 60s                      |    autovacuum_naptime = 1min
autovacuum = on                            autovacuum = on
                                  >    autovacuum_vacuum_cost_delay = 2ms
                                  >    autovacuum_vacuum_cost_limit = -1
                                  >    autovacuum_vacuum_insert_scale_factor = 0.2
                                  >    autovacuum_vacuum_insert_threshold = 1000
autovacuum_vacuum_scale_factor = 0.2                autovacuum_vacuum_scale_factor = 0.2
autovacuum_vacuum_threshold = 50                autovacuum_vacuum_threshold = 50
checkpoint_timeout = 30s                      |    autovacuum_work_mem = -1
...
and so on


В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Set COLLATE on a session level
Следующее
От: Kevin Brannen
Дата:
Сообщение: RE: Alter the column data type of the large data volume table.