-
Notifications
You must be signed in to change notification settings - Fork 2
/
Commands.txt
50 lines (38 loc) · 2.23 KB
/
Commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Postgres Commands
$ psql -U postgres
#psql (15.1 (Ubuntu 15.1-1.pgdg22.04+1))
#Type "help" for help.
postgres=# create database demo_streaming;
#CREATE DATABASE
postgres=# \c demo_streaming
#You are now connected to database "demo_streaming" as user "postgres".
demo_streaming=# create table venkat_demo (StartTime timestamptz not null, EndTime timestamptz not null, Bank_Name text, Avg_OpenPrice double precision, Avg_HighPrice double precision, Avg_LowPrice double precision, Avg_ClosePrice double precision, Avg_Volume double precision);
#CREATE TABLE
demo_streaming=# \d venkat_demo
Table "public.venkat_demo"
Column | Type | Collation | Nullable | Default
----------------+--------------------------+-----------+----------+---------
starttime | timestamp with time zone | | not null |
endtime | timestamp with time zone | | not null |
avg_openprice | double precision | | |
avg_highprice | double precision | | |
avg_lowprice | double precision | | |
avg_closeprice | double precision | | |
avg_volume | double precision | | |
demo_streaming=# select create_hypertable('venkat_demo', 'starttime');
demo_streaming=# \d venkat_demo
Table "public.venkat_demo"
Column | Type | Collation | Nullable | Default
----------------+--------------------------+-----------+----------+---------
starttime | timestamp with time zone | | not null |
endtime | timestamp with time zone | | not null |
avg_openprice | double precision | | |
avg_highprice | double precision | | |
avg_lowprice | double precision | | |
avg_closeprice | double precision | | |
avg_volume | double precision | | |
Indexes:
"venkat_demo_starttime_idx" btree (starttime DESC)
Triggers:
ts_insert_blocker BEFORE INSERT ON venkat_demo FOR EACH ROW EXECUTE FUNCTION _timescaledb_internal.insert_blocker()