在 pipelinedb 中,我似乎找不到列出我创建的所有流和连续视图的方法。
我可以通过查找创建的“mrel”表返回 CV,但它有点笨重。
是否有我可以查询的系统表或视图来列出它们?
在 pipelinedb 中,我似乎找不到列出我创建的所有流和连续视图的方法。
我可以通过查找创建的“mrel”表返回 CV,但它有点笨重。
是否有我可以查询的系统表或视图来列出它们?
您可能拥有旧版本的 pipelinedb,或者您可能正在查看旧版本的文档。
您可以使用 psql 检查您的版本,如下所示:
pipeline=# select * from pipeline_version();
pipeline_version
-----------------------------------------------------------------------------------------------------------------------------------------------------------
PipelineDB 0.9.0 at revision b1ea9ab6acb689e6ed69fb26af555ca8d025ebae on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4, 64-bit
(1 row)
在最新版本中,可以像这样获取有关视图的信息:
pipeline=# select * from pipeline_views();
id | schema | name | query
----+--------+------+-----------------------
11 | public | cv | SELECT x::integer, +
| | | count(*) AS count+
| | | FROM ONLY s +
| | | GROUP BY x::integer
(1 row)
可以像这样获取有关流的信息:
pipeline=# select * from pipeline_streams();
schema | name | inferred | queries | tup_desc
--------+------+----------+---------+----------------------------------------
public | s | t | {cv} | \x000000017800000006a4ffffffff00000000
(1 row)
使用 \d+ 可以获得更多信息:
pipeline=# \d+ cv
Continuous view "public.cv"
Column | Type | Modifiers | Storage | Description
--------+---------+-----------+---------+-------------
x | integer | | plain |
count | bigint | | plain |
View definition:
SELECT x::integer,
count(*) AS count
FROM ONLY s
GROUP BY x::integer;
pipeline=# \d+ s
Stream "public.s"
Column | Type | Storage
-------------------+-----------------------------+---------
arrival_timestamp | timestamp(0) with time zone | plain
这很容易,
写吧
select * from pipeline_streams();
要查看管道流及其内部,您可以查看哪个流具有哪些视图。
编辑:上面的代码片段仅适用于 0.9.x 版本的 PipelineDB,因为它是 1.x 版本的 PostgreSQL 扩展,您将使用外部表作为流
psql -c "\dE[S+];"
此代码将向您显示 psql 上的所有外部表(pipelinedb 上的流)。