开发者社区> 问答> 正文

有人对max_prepared_transactions这个参数有了解过么?看了官网,没太懂什么叫准备事务数

有人对max_prepared_transactions这个参数有了解过么?看了官网,没太懂什么叫准备事务数
本问题来自云栖社区【PostgreSQL技术进阶社群】。https://yq.aliyun.com/articles/690084 点击链接欢迎加入社区大社群。

展开
收起
游客886 2019-06-12 16:03:24 2823 0
1 条回答
写回答
取消 提交回答
  • BEGIN
    postgres=# create table abcdef(id int);
    CREATE TABLE
    postgres=# PREPARE TRANSACTION 'hello';
    PREPARE TRANSACTION
    postgres=# select * from pg_2
    
    postgres=# select * from pg_2
    
    postgres=# select * from pg_x
    
    postgres=# select * from pg_x
    
    postgres=# select * from pg_prepared_
    pg_prepared_statements  pg_prepared_xacts       
    postgres=# select * from pg_prepared_xacts ;
     transaction |  gid  |           prepared            |  owner   | database 
    -------------+-------+-------------------------------+----------+----------
          749441 | hello | 2019-06-10 17:11:49.305841+08 | postgres | postgres
    (1 row)
    
    postgres=# select * from abcdef;
    psql: ERROR:  relation "abcdef" does not exist
    LINE 1: select * from abcdef;
                          ^
    postgres=# commit prepared 'hello';
    COMMIT PREPARED
    postgres=# select * from abcdef;
     id 
    ----
    (0 rows)
    
    2019-07-17 23:37:03
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spark SQL: Past, Present and Future 立即下载
Spark SQL:Past Present &Future 立即下载
低代码开发师(初级)实战教程 立即下载