首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏PostgreSQL研究与原理解析

    PgSQL - 内核插件 - pg_dirtyread

    PgSQL - 内核插件 - pg_dirtyread 表中删除了记录,并且没有进行vacuum,此时可以通过pg_dirtyread扩展读取死记录。 1、使用方法 CREATE EXTENSION pg_dirtyread; SELECT * FROM pg_dirtyread('tablename') AS t(col1 type1, col2 type2 注:pg_dirtyread入参使用表的OID也可以,当然若使用表名则会在代码中转换成表的OID。 oid列在PG11及其之后版本使用: 2、原理 pg_dirtyread.c主要是面向用户使用的API函数接口pg_dirtyread的实现: Datum pg_dirtyread(PG_FUNCTION_ARGS 3、参考 https://github.com/df7cb/pg_dirtyread

    60110编辑于 2024-04-12
  • 来自专栏DBA实战

    PostgreSQL数据闪回工具Pg_Dirtyread

    通过使用pg_dirtyread,可以快速查看未提交的删除或更新事务,恢复数据,从而恢复正常服务、确保数据完整、数据一致。 优缺点 pg_dirtyread 插件非常方便,它可以通过安装来找回数据。 该插件会返回所有数据,包括那些未被删除的数据。 由于 PostgreSQL 的 MVCC 机制,pg_dirtyread 只能用于找回 DML 操作的数据。 但是一旦 VACUUM 清除了 Dead 元组,数据就无法通过 pg_dirtyread 恢复。 安全性问题:使用 pg_dirtyread 读取未提交的数据可能会带来数据一致性和安全性问题。 在事务提交前,pg_dirtyread 提供了一种便捷的数据恢复方法。

    66710编辑于 2024-12-05
  • 来自专栏AustinDatabases

    PostgreSQL 可以数据找回了,MySQL还不可以吗?

    https://github.com/df7cb/pg_dirtyread/releases/tag/2.6 root@pg16:~/pg_dirtyread-2.6# source /home/postgres pg_dirtyread--1.0.sql pg_dirtyread.c README.md tupconvert.c.upstream debian dirtyread_tupconvert.h LICENSE pg_dirtyread--1.0--2.sql pg_dirtyread--2.sql pg_dirtyread.control sql tupconvert.h.upstream pg_dirtyread.o dirtyread_tupconvert.o -L/usr/local/postgres/libs -Wl,--as-needed -Wl,-rpath,'/usr //pg_dirtyread--1.0.sql .//pg_dirtyread--1.0--2.sql .

    53710编辑于 2024-04-15
  • 来自专栏Postgresql源码分析

    Postgresql实验系列(3)最简脏读插件

    false, toast.autovacuum_enabled = false); INSERT INTO foo VALUES (1, 'Hello world'); SELECT * FROM dirtyread ('foo') as t(bar bigint, baz text); DELETE FROM foo; SELECT * FROM dirtyread('foo') as t(bar bigint, 4. get_call_result_type 拿到输出元组格式,例如当前用例: SELECT * FROM dirtyread('foo') as t(bar bigint, baz text); 会得到 scan; } dirtyread_ctx_state; PG_MODULE_MAGIC; PG_FUNCTION_INFO_V1(dirtyread); Datum dirtyread(PG_FUNCTION_ARGS ) { FuncCallContext *funcctx; dirtyread_ctx_state *inter_call_data = NULL; HeapTuple tuple; if (

    65720编辑于 2022-11-06
  • 来自专栏后端码匠

    高并发编程系列(一)

    容易产生脏读问题(dirtyRead). public class Tg { /** * * Locks the business write method. * DirtyRead is easy to produce.

    40540发布于 2019-10-15
  • 来自专栏后端码匠

    高并发编程系列

    容易产生脏读问题(dirtyRead).** public class Tg { /** * * Locks the business write method. * DirtyRead is easy to produce.

    52230发布于 2019-10-09
  • 来自专栏AustinDatabases

    回复群友问题,PostgreSQL Extensions 那些是常用的

    pg_freespacemap,pg_stat_monitor, pg_profile, pg_wait_sampling, pgpro_stats, pgmetrics,pg_squeeze, pg_repack, pg_dirtyread pg_buffercache都可以,还有一些如pg_prewarm 数据预热缓冲区,在比如表空间收缩的 pg_squeeze,pg_repack,还有模拟ORACLE数据库可以读取曾经修改前的历史数据的功能 pg_dirtyread

    20010编辑于 2025-11-14
  • 来自专栏AustinDatabases

    MySQL 的FLASHBACK 数据回滚

    并且还让生产的应用不停止,这是一个数据库管理员都想拥有的功能, SQL SERVER 需要借助第三方软件的功能,可以完成数据的回滚和恢复,ORACLE 独有的FLASHBACK 功能,以及POSTGRESQL 的pg_dirtyread

    3.6K30发布于 2019-06-21
  • MySQL事务隔离级别:揭秘InnoDB中MVCC与ReadView、Undo Log是如何解决问题的

    脏读(DirtyRead)现象:事务T1修改了数据但未提交,事务T2读取到了T1未提交的数据。危害:T1若回滚,T2的数据即为“脏”数据。哪个级别会发生:ReadUncommitted。 隔离级别vs并发问题隔离级别脏读(DirtyRead)不可重复读(Non-Repeatable)幻读(PhantomRead)ReadUncommitted❌(会)❌(会)❌(会)ReadCommitted

    40910编辑于 2025-11-13
  • 来自专栏小麦苗的DB宝专栏

    使用yum来安装PostgreSQL数据库(从PG9.4到PG16各个版本通用)

    export PATH=/usr/pgsql-13/bin:$PATH" >> /etc/profile -- (建议安装)安装开发包,若后期需要编译一些插件,例如pg_recovery、pg_dirtyread

    6.4K40编辑于 2023-09-19
  • 来自专栏小麦苗的DB宝专栏

    PostgreSQL 16数据库的各种安装方式汇总(yum、编译、docker等)

    x86_64.rpm -- 安装pg dnf localinstall postgresql16-* -- (建议安装)安装开发包,若后期需要编译一些插件,例如pg_recovery、pg_dirtyread

    8.6K60编辑于 2023-09-19
  • 来自专栏Goboy

    读懂MySQL事务隔离

    事务可以读取未提交的数据,这也被称为脏读(DirtyRead)。

    60350编辑于 2024-01-16
  • 来自专栏海仔技术驿站

    并发编程

    脏读 对于对象的同步和异步的方法,我们在设计自己的程序的时候,一定要考虑问题的整体,不然就会出现数据不一致的错误,很经典的错误就是脏读(dirtyread) 总结 :

    67330发布于 2019-08-06
  • 来自专栏mysql知识提炼

    mysql事务及MVCC

    canoccur.Thislevelallowsarowchangedbyonetransactiontobereadby*anothertransactionbeforeanychangesinthatrowhavebeencommitted*(a"dirtyread

    15910编辑于 2026-04-05
  • 来自专栏golang与云原生

    【笔记】Go Coding In Go Way

    中不存在对应的 entry,因此dirty新增entry并将read的p设置为 nil 状态read 中不存在 key 或 该 key 不可直接更新:上锁read 中 存在 key:则同时更新 read 和 dirtyread

    39410编辑于 2024-11-07
  • 来自专栏腾讯技术工程官方号的专栏

    免费开放阅读 | 数据库管理系统的事务原理(上)

    P1 DirtyRead:脏读,1.1.3节表 1-2。 P4 CCursorLostUpdate:游标丢失更新,1.1.6节表 1-6。

    1.8K81发布于 2018-03-12
  • 来自专栏Ray学习笔记

    Java多线程编程核心技术

    虽然在赋值时进行了同步,但在取值时有可能出现一些意想不到的意外,这种情况就是脏读(dirtyRead)。发生脏读的情况是在读取实例变量时,此值已经被其他线程更改过了。

    2.3K30发布于 2020-08-05
领券