zoukankan      html  css  js  c++  java
  • postgresql lsn/location 获取 wal/xlog 文件名

    postgresql 10.x 叫做 wal、lsn
    postgresql 9.x 叫做 xlog、location

    在实际应用中经常需要根据 lsn/location 获取 wal/xlog 文件名

    postgresql 10.x

    postgres=# select pg_current_wal_lsn();
     pg_current_wal_lsn 
    --------------------
     0/1656FE0
    (1 row)
    
    postgres=# select pg_current_wal_lsn(),
               pg_walfile_name(pg_current_wal_lsn()),
               pg_walfile_name_offset(pg_current_wal_lsn());
    
     pg_current_wal_lsn |     pg_walfile_name      |       pg_walfile_name_offset   
    
    --------------------+--------------------------+------------------------------------
     0/1656FE0          | 000000010000000000000001 | (000000010000000000000001,6647776)
    (1 row)
    

    postgresql 9.x

    postgres=# select pg_current_xlog_location();
     pg_current_xlog_location 
    --------------------------
     596/C4DA2000
    (1 row)
    
    postgres=# select pg_current_xlog_location(),
                      pg_xlogfile_name(pg_current_xlog_location()),
                      pg_xlogfile_name_offset(pg_current_xlog_location());
    
     pg_current_xlog_location |     pg_xlogfile_name     |       pg_xlogfile_name_offset       
    --------------------------+--------------------------+-------------------------------------
     596/C4DA2000             | 0000000100000596000000C4 | (0000000100000596000000C4,14295040)
    
    (1 row)
    
  • 相关阅读:
    Winefish-GTK LaTeX 编辑器
    GPuTTY:SSH 会话治理器
    Zudeo──高清版 Youtube
    HardInfo-体系信息搜集对象
    Liferea 1.2.0 正式版
    HomeBank:家庭理财软件
    ParolaPass:暗码天生器
    VLC Media Player 0.8.6
    流程图的绘制方法
    Delphi 2009 中的匿名方法(reference to)
  • 原文地址:https://www.cnblogs.com/ctypyb2002/p/9793046.html
Copyright © 2011-2022 走看看