我运行的Postgres查询在Visual Studio中运行时没有返回任何输出。在PGAdmin中,其他更简单的查询都会返回正确的输出,但是这个查询不能。这个文件的结构是
drop table if exists temp_one;
drop table if exists temp_two;
create temp table temp_one as
select (some query);
create temp table temp_two as
select (some other query);
select *
from temp_one
join temp_two on temp_one.foo = temp_two.foo运行整个过程没有任何结果,但是只运行最后一次select确实会返回正确的结果,假设temp_one和temp_two已经在这个会话中正确创建了。
有人知道为什么Visual Studio不生成输出吗?谢谢
发布于 2013-03-24 15:47:22
许多这样的工具(现在包括pg_admin)不会返回与脚本同时运行的多个查询的结果。目前,如果这些都作为事务运行,pgAdmin也不会执行此操作。最好的办法是使用psql这样的工具运行查询,这样可以更好地控制输出。psql接口实际上非常强大,它为您提供了IDE所不具备的许多功能,包括循环浏览多个查询的结果的能力。
https://stackoverflow.com/questions/8484378
复制相似问题