Anc*_*nek 5 postgresql macos homebrew postgresql-12
我刚刚坐下来工作,忘记了我已经在 2020 \xe2\x80\x93 中升级了brew,所以我当然遇到了 postgresql 问题。
\n我的最后一个版本是 12.x。现在我已经安装了13.1:
\n$ brew info postgres \nWarning: Treating postgres as a formula. For the cask, use homebrew/cask/postgres\npostgresql: stable 13.1 (bottled), HEAD\nObject-relational database system\nhttps://www.postgresql.org/\n/usr/local/Cellar/postgresql/13.1 (3,217 files, 42.6MB) *\n Poured from bottle on 2020-12-26 at 14:36:54\nFrom: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/postgresql.rb\nLicense: PostgreSQL\n==> Dependencies\nBuild: pkg-config \xe2\x9c\x94\nRequired: icu4c \xe2\x9c\x94, krb5 \xe2\x9c\x94, openssl@1.1 \xe2\x9c\x94, readline \xe2\x9c\x94\n==> Options\n--HEAD\n Install HEAD version\n==> Caveats\nTo migrate existing data from a previous major version of PostgreSQL run:\n brew postgresql-upgrade-database\n\nThis formula has created a default database cluster with:\n initdb --locale=C -E UTF-8 /usr/local/var/postgres\nFor more details, read:\n https://www.postgresql.org/docs/13/app-initdb.html\n\nTo have launchd start postgresql now and restart at login:\n brew services start postgresql\nOr, if you don't want/need a background service you can just run:\n pg_ctl -D /usr/local/var/postgres start\n==> Analytics\ninstall: 181,394 (30 days), 574,628 (90 days), 1,984,700 (365 days)\ninstall-on-request: 176,623 (30 days), 554,629 (90 days), 1,910,250 (365 days)\nbuild-error: 0 (30 days)\nRun Code Online (Sandbox Code Playgroud)\n根据输出,我尝试运行brew postgresql-upgrade-database,但它不起作用 \xe2\x80\x93\xc2\xa0here 是输出:
$ brew postgresql-upgrade-database --debug --verbose\n/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/postgresql.rb\n==> Upgrading postgresql data from 12 to 13...\n/usr/local/Cellar/postgresql@12/12.5/bin/pg_ctl -w -D /usr/local/var/postgres start\nwaiting for server to start....2021-01-04 17:37:33.282 CET [8190] FATAL: database files are incompatible with server\n2021-01-04 17:37:33.282 CET [8190] DETAIL: The database cluster was initialized with PG_CONTROL_VERSION 1300, but the server was compiled with PG_CONTROL_VERSION 1201.\n2021-01-04 17:37:33.282 CET [8190] HINT: It looks like you need to initdb.\n2021-01-04 17:37:33.282 CET [8190] LOG: database system is shut down\n stopped waiting\npg_ctl: could not start server\nExamine the log output.\n==> Moving postgresql data from /usr/local/var/postgres to /usr/local/var/postgres.old...\n==> Creating database...\n/usr/local/opt/postgresql/bin/initdb /usr/local/var/postgres\nThe files belonging to this database system will be owned by user "nyc".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locale "en_US.UTF-8".\nThe default database encoding has accordingly been set to "UTF8".\nThe default text search configuration will be set to "english".\n\nData page checksums are disabled.\n\nfixing permissions on existing directory /usr/local/var/postgres ... ok\ncreating subdirectories ... ok\nselecting dynamic shared memory implementation ... posix\nselecting default max_connections ... 100\nselecting default shared_buffers ... 128MB\nselecting default time zone ... Europe/Warsaw\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\ninitdb: warning: enabling "trust" authentication for local connections\nYou can change this by editing pg_hba.conf or using the option -A, or\n--auth-local and --auth-host, the next time you run initdb.\n\nSuccess. You can now start the database server using:\n\n /usr/local/opt/postgresql/bin/pg_ctl -D /usr/local/var/postgres -l logfile start\n\n==> Migrating and upgrading data...\n/usr/local/opt/postgresql/bin/pg_upgrade -r -b /usr/local/Cellar/postgresql@12/12.5/bin -B /usr/local/opt/postgresql/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres -j 4\nPerforming Consistency Checks\n-----------------------------\nChecking cluster versions ok\n\nThe source cluster was not shut down cleanly.\nFailure, exiting\nError: Upgrading postgresql data from 12 to 13 failed!\n==> Removing empty postgresql initdb database...\n==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/var/postgres...\nError: Failure while executing; `/usr/local/opt/postgresql/bin/pg_upgrade -r -b /usr/local/Cellar/postgresql@12/12.5/bin -B /usr/local/opt/postgresql/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres -j 4` exited with 1.\n/usr/local/Homebrew/Library/Homebrew/utils.rb:303:in `safe_system'\n/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/cmd/postgresql-upgrade-database.rb:126:in `block in postgresql_upgrade_database'\n/usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:318:in `block in cd'\n/usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:318:in `chdir'\n/usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:318:in `cd'\n/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/cmd/postgresql-upgrade-database.rb:125:in `postgresql_upgrade_database'\n/usr/local/Homebrew/Library/Homebrew/brew.rb:124:in `<main>'\nRun Code Online (Sandbox Code Playgroud)\n我怎样才能解决这个问题?
\n| 归档时间: |
|
| 查看次数: |
1819 次 |
| 最近记录: |