简体   繁体   English

postgres 重启后视图丢失

[英]View missing after postgres restart

When I create a postgres view like this;当我创建这样的 postgres 视图时;

create view sp_pool_relay_cnt as 
select hash_id, count(hash_id) as relay_cnt from sp_pool_relay
group by hash_id;

Then i restart restart using;然后我重新启动使用;

sudo systemctl restart postgresql

then my view disappears, how do i make it permanent?然后我的视图消失了,我如何使它永久化?

I created a new test database and view, restarted the database and the view was available as expected, no issue with postgres.我创建了一个新的测试数据库和视图,重新启动了数据库,视图按预期可用,postgres 没有问题。 subsequently tracked the behavior to a startup script acting on the database.随后将行为跟踪到作用于数据库的启动脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM