V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhengfan2016
V2EX  ›  PostgreSQL

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

  •  
  •   zhengfan2016 · 4 天前 · 1247 次点击

    如题,因为服务器死机断电重启,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 条回复    2025-04-06 13:58:03 +08:00
    Gannicus5
        1
    Gannicus5  
       3 天前
    牛逼啊,命令干啥用的都不知道直接线上跑
    oneisall8955
        2
    oneisall8955  
       3 天前
    生产数据库?准备提桶跑路吧
    proxytoworld
        3
    proxytoworld  
       3 天前
    有 reset 你还敢执行啊
    zhengfan2016
        4
    zhengfan2016  
    OP
       3 天前
    @Gannicus5
    @proxytoworld

    肯定粗略看过的啊,sql 都 panic 了,不执行的话进都进不去。
    而且这个也是一个乌龙,纯粹就是我用 dbeaver 的时候没把显示其他数据库的选项打开,数据其实是还在的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1669 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 16:30 · PVG 00:30 · LAX 09:30 · JFK 12:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.