Reputation: 55
In pipelinedb I can't seem to locate a way to list all of the streams and continuous views that I've created.
I can back into the CVs by looking for the "mrel" tables that are created but it's kind of clunky.
Is there a system table or view I can query that will list them?
Upvotes: 2
Views: 1010
Reputation: 157
It's easy peasy,
just write
select * from pipeline_streams();
To see pipelinestreams and inside of it u can see which stream has which views.
Edit: Above code snippet is only for 0.9.x version of PipelineDB since it is PostgreSQL extension with version 1.x you will use foreign tables as a streams
psql -c "\dE[S+];"
This code will show you all foreign tables on psql (Streams on pipelinedb).
For more information : http://docs.pipelinedb.com/streams.html
Upvotes: 1
Reputation: 36
You may have an older version of pipelinedb, or you may be looking at an older version of the docs.
You can check your version with psql like so:
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)
In the latest version, information about views can be obtained like so:
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)
Information about streams can be obtained like so:
pipeline=# select * from pipeline_streams();
schema | name | inferred | queries | tup_desc
--------+------+----------+---------+----------------------------------------
public | s | t | {cv} | \x000000017800000006a4ffffffff00000000
(1 row)
More information can be obtained by using \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
Upvotes: 2