V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
zhengfan2016

按照 stackoverflow 教程执行 pg_resetwal, postgresql 的数据库被清空了

  •  
  •   zhengfan2016 · Apr 5, 2025 · 3662 views
    This topic created in 395 days ago, the information mentioned may be changed or developed.

    如题,因为服务器死机断电重启,postgresql 报错了,postgresql error PANIC: could not locate a valid checkpoint record ,按照这个教程:

    https://stackoverflow.com/questions/8799474/postgresql-error-panic-could-not-locate-a-valid-checkpoint-record

    pg_resetwal /var/lib/postgresql/data
    

    结果,postgresql 正常运行,但是数据库空了,只剩下 postgres 库,其他数据库全部丢失了,这是因为执行完这个命令导致的吗

    4 replies    2025-04-06 13:58:03 +08:00
    Gannicus5
        1
    Gannicus5  
       Apr 6, 2025
    牛逼啊,命令干啥用的都不知道直接线上跑
    itechify
        2
    itechify  
    PRO
       Apr 6, 2025
    生产数据库?准备提桶跑路吧
    proxytoworld
        3
    proxytoworld  
       Apr 6, 2025
    有 reset 你还敢执行啊
    zhengfan2016
        4
    zhengfan2016  
    OP
       Apr 6, 2025
    @Gannicus5
    @proxytoworld

    肯定粗略看过的啊,sql 都 panic 了,不执行的话进都进不去。
    而且这个也是一个乌龙,纯粹就是我用 dbeaver 的时候没把显示其他数据库的选项打开,数据其实是还在的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   818 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 19:19 · PVG 03:19 · LAX 12:19 · JFK 15:19
    ♥ Do have faith in what you're doing.