支持增加列/删除列的闪回查询 本页为您介绍增加列/删除列的闪回查询的方法。 在foo表增加info列,并插入数据 plaintext teledb alter table foo add column info text; ALTER TABLE teledb insert into foo values (7,'ggg', 'new added column'); INSERT 0 1 查询给定时间点的历史数据(增加列情况) plaintext teledb SELECT pgxactcommittimestamp(xmin) as xmintime, pgxactcommittimestamp(case xmax when 0 then null else xmax end) as xmaxtime, FROM pgdirtyread('foo') AS t(tableoid oid, ctid tid, xmin xid, xmax xid, cmin cid, cmax cid, dead boolean,bar bigint, baz text, info text) where (pgxactcommittimestamp(xmin) < ' 20231102 16:43:02' and (pgxactcommittimestamp(case xmax when 0 then null else xmax end) < '20231102 16:43:02') is distinct from true ) ; xmintime xmaxtime tableoid ctid xmin xmax cmin cmax dead bar baz info +++++++++++ 20231102 16:42:47.230036+08 16432 (0,3) 680 0 0 0 f 5 eee 20231102 16:42:41.46109+08 16432 (0,3) 659 0 0 0 f 3 cccnew2 (2 rows) 删除baz列 plaintext teledb ALTER TABLE foo DROP COLUMN baz; ALTER TABLE 查询给定时间点的历史数据(删除列情况) 使用droppedN来访问第N列,从1开始计数。例如dropped2 表示foo表被删除的第二列baz列。 plaintext teledb