pgAdmin4:每次运行查询时都需要恢复数据库 - 如何修复此错误?

问题描述 投票:0回答:1

我是Mac OS用户,我在pgAdmin 4上使用.tar文件作为我的数据库源。我发现每次运行查询时,数据都会丢失,我需要在执行下一个查询之前恢复数据。例如,

执行后:

SELECT * FROM film;

我需要再次从我的.tar文件恢复数据来执行:

SELECT * FROM film WHERE amount=7.99;

如果我在执行第二个查询之前没有恢复数据,则第二个查询只返回一个空表。

我该如何解决这个错误?

谢谢,

postgresql pgadmin pgadmin-4
1个回答
0
投票

检查“电影”是否不是规则和观点。它可能像是:

t=# create table t (i int);
CREATE TABLE
t=# insert into t select 1;
INSERT 0 1
t=# create or replace function f() returns table (i int) as ' begin return query delete from t returning *; end; ' language plpgsql;
CREATE FUNCTION
t=# create or replace view v as select * from f();
CREATE VIEW

t=# select * from v;
 i
---
 1
(1 row)

t=# select * from v;
 i
---
(0 rows)
© www.soinside.com 2019 - 2024. All rights reserved.