PostgreSQL View current log

[postgres@zwc pg_xlog]$ psql -h 192.168.1.13 -p 1521 -U zwc -d testdb
Password for user zwc: 
psql (9.2.4)
Type "help" for help.

testdb=> select pg_current_xlog_location();
 pg_current_xlog_location 
--------------------------
 0/8000000
(1 row)

testdb=> select pg_xlogfile_name(pg_current_xlog_location());
     pg_xlogfile_name     
--------------------------
 000000010000000000000001
(1 row)

testdb=> 
testdb=> 
testdb=> \dt
         List of relations
 Schema |   Name    | Type  | Owner 
--------+-----------+-------+-------
 public | orderinfo | table | zwc
(1 row)

testdb=> create table t01(id integer,name varchar(30));
CREATE TABLE
testdb=> \dt
         List of relations
 Schema |   Name    | Type  | Owner 
--------+-----------+-------+-------
 public | orderinfo | table | zwc
 public | t01       | table | zwc
(2 rows)

testdb=> insert into t01 values(1,'aaa');
INSERT 0 1


[postgres@zwc pg_xlog]$ psql
psql (9.2.4)
Type "help" for help.

postgres=# select pg_switch_xlog();
 pg_switch_xlog 
----------------
 0/80151D0
(1 row)

postgres=# select pg_xlogfile_name(pg_current_xlog_location());
     pg_xlogfile_name     
--------------------------
 000000010000000000000002
(1 row)

postgres=# \! ls -l
total 131312
-rw------- 1 postgres postgres 67108864 Sep  2 14:28 000000010000000000000001
-rw------- 1 postgres postgres 67108864 Sep  2 14:30 000000010000000000000002
drwx------ 2 postgres postgres     4096 Aug 28 12:56 archive_status
-rw-rw-r-- 1 postgres postgres    96147 Sep  2 14:30 gmon.out
postgres=# 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值