1

我有一些返回引用游标的存储过程。该手册提出了一种有点复杂的方法来执行它们并查看结果:

-- need to be in a transaction to use cursors.
BEGIN;
SELECT reffunc2();

      reffunc2
--------------------
 <unnamed cursor 1>
(1 row)

FETCH ALL IN "<unnamed cursor 1>";
COMMIT;

当我尝试这样做时,我的 SQL Manager Lite 挂在我身上。我使用 C# 开发的客户端的结果集没有问题。

我的用户和我应该使用一个简单的工具来执行返回 ref 游标的存储过程吗?

4

1 回答 1

1

In general, my experience is that the command-line psql client is the single best general tool you will ever find for PostgreSQL. It is intended for scripting and can generate all kinds of different output formats, but it also works fine interactively. Refcursors can be a bit odd, as many of the GUI tools do not handle them very well (as there is no interaction within a transaction). IIRC, this is an issue with pgadmin too.

Otherwise, if you have something more special-purpose, your best bet is to build a tool for that purpose only.

于 2013-12-03T03:20:25.837 回答