Describe the bug
通过SPI接口/plpgsql执行commit/rollback后,继续执行语句会报错:ERROR: no known snapshots
To Reproduce
问题复现用例:
CREATE TABLE test1 (a int, b text);
ALTER TABLE test1 ALTER COLUMN b SET STORAGE EXTERNAL;
INSERT INTO test1 VALUES (1, repeat('foo', 2000));
insert into test1 values (2, repeat('bar', 3000));
insert into test1 values (3, repeat('baz', 4000));
do $$
declare
r record;
t text;
begin
for r in select test1.a from test1 loop
commit;
select b into t from test1 where a = r.a;
raise notice 'length(t) = %', length(t);
end loop;
end;
$$;
Expected behavior
A clear and concise description of what you expected to happen.
预期是正常执行不报错,并且通过notice日志打印3条数据的长度
Describe the bug 通过SPI接口/plpgsql执行commit/rollback后,继续执行语句会报错:
ERROR: no known snapshots
To Reproduce 问题复现用例:
Expected behavior A clear and concise description of what you expected to happen. 预期是正常执行不报错,并且通过notice日志打印3条数据的长度
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context Add any other context about the problem here.