简体   繁体   中英

postgresql.conf in macOS Big Sur

I'm on a macOS Big Sur , and struggling to find the config file postgresql.conf

While in /Applications/Postgres.app/Contents/Versions/13 I ran this

➜  13 find . -type f -name "postgresql.conf"
➜  13 
➜  13 
➜  13 pwd
/Applications/Postgres.app/Contents/Versions/13

If I go into share/postgresql/ I see a bunch of sample files, but that is not what I am looking for

➜  postgresql L
total 2264
drwxr-xr-x@  15 alpha  admin     480 Nov 11  2020 timezonesets
drwxr-xr-x@  63 alpha  admin    2016 Nov 11  2020 timezone
drwxr-xr-x@  28 alpha  admin     896 Nov 11  2020 tsearch_data
drwxr-xr-x@   8 alpha  admin     256 Nov 11  2020 ..
drwxr-xr-x@   3 alpha  admin      96 Nov 11  2020 contrib
drwxr-xr-x@  18 alpha  admin     576 Nov 11  2020 .
drwxr-xr-x@ 491 alpha  admin   15712 Nov 11  2020 extension
-rw-r--r--@   1 alpha  admin   54635 Nov 11  2020 system_views.sql
-rw-r--r--@   1 alpha  admin     604 Nov 11  2020 pg_service.conf.sample
-rw-r--r--@   1 alpha  admin    1636 Nov 11  2020 pg_ident.conf.sample
-rw-r--r--@   1 alpha  admin   35193 Nov 11  2020 sql_features.txt
-rw-r--r--@   1 alpha  admin   35082 Nov 11  2020 snowball_create.sql
-rw-r--r--@   1 alpha  admin     278 Nov 11  2020 psqlrc.sample
-rw-r--r--@   1 alpha  admin   27924 Nov 11  2020 postgresql.conf.sample. <<< ⭐️⭐️⭐️
-rw-r--r--@   1 alpha  admin  829316 Nov 11  2020 postgres.bki
-rw-r--r--@   1 alpha  admin    4674 Nov 11  2020 pg_hba.conf.sample
-rw-r--r--@   1 alpha  admin  109729 Nov 11  2020 information_schema.sql
-rw-r--r--@   1 alpha  admin   33239 Nov 11  2020 errcodes.txt
➜  postgresql pwd
/Applications/Postgres.app/Contents/Versions/13/share/postgresql

I tried to go back further and search there

find . -type f -name "postgresql.*"   


./Contents/Versions/13/share/postgresql/postgresql.conf.sample

I only found the sample file: postgresql.conf.sample

If you know, please help....

Only

if I installed via brew , I will be located at

/usr/local/var/postgres

➜  postgres L
total 104
drwxrwxr-x@  9 alpha  admin    288 Dec  2 12:21 ..
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_commit_ts
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_dynshmem
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_notify
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_serial
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_snapshots
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_twophase
drwx------   4 alpha  admin    128 Dec  2 12:21 pg_multixact
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_replslot
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_tblspc
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_stat
drwx------   2 alpha  admin     64 Dec  2 12:21 pg_stat_tmp
-rw-------   1 alpha  admin      3 Dec  2 12:21 PG_VERSION
-rw-------   1 alpha  admin  28731 Dec  2 12:21 postgresql.conf <<<<<<<<< 
-rw-------   1 alpha  admin     88 Dec  2 12:21 postgresql.auto.conf
-rw-------   1 alpha  admin   4789 Dec  2 12:21 pg_hba.conf
-rw-------   1 alpha  admin   1636 Dec  2 12:21 pg_ident.conf
drwx------   4 alpha  admin    128 Dec  2 12:21 pg_wal
drwx------   3 alpha  admin     96 Dec  2 12:21 pg_xact
drwx------   3 alpha  admin     96 Dec  2 12:21 pg_subtrans
drwx------  59 alpha  admin   1888 Dec  2 12:21 global
drwx------   5 alpha  admin    160 Dec  2 12:21 base
drwx------   5 alpha  admin    160 Dec  2 12:21 pg_logical
drwx------  24 alpha  admin    768 Dec  2 12:21 .

Your DB keeps this information for you. Connect to your database and run show commands. Eg

postgres> # show config_file ;
-[ RECORD 1 ]----------------------------------------------------------
config_file | [your directory structure]/postgresql.conf

postgres> # show data_directory ;
-[ RECORD 1 ]--+------------------------------------------
data_directory | [your directory structure]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM