如何列出pipelinedb中的所有流和连续视图



在pipelinedb中,我似乎找不到列出我创建的所有流和连续视图的方法。

我可以通过查找创建的"mrel"表来返回简历,但这有点笨拙。

有没有我可以查询的系统表或视图会列出它们?

您可能有一个较旧版本的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();

要查看管道流及其内部,您可以查看哪个流具有哪些视图。

编辑:以上代码片段仅适用于PipelineDB的0.9.x版本,因为它是1.x版本的PostgreSQL扩展,您将使用外部表作为流

psql -c "dE[S+];"

这段代码将显示psql(pipelinedb上的Streams)上的所有外部表。

有关详细信息:http://docs.pipelinedb.com/streams.html

最新更新