Quantcast
Channel: TimescaleDB and PostgreSQL - Timescale Community Forum
Viewing all articles
Browse latest Browse all 291

First steps in postgres

$
0
0

Hi to all,
I’m new with Timescale and working on creating a table with 60 columns. I’ve included the DDL below, and I’m wondering if there are any best practices I should be aware of or if anyone has suggestions on optimizing this structure. Additionally, I’m unsure about some of the permissions and the hypertable creation – any feedback would be appreciated!

CREATE TABLE dwh_conta.reading (
a_plus_frame varchar(500),
alarm int,
alarm_stat int,

qmin_time varchar(250),
read_date varchar(250),
read_date_time timestamp,
read_date_time_utc varchar(250),
read_time varchar(250),

wd_5_vol numeric
);

alter table dwh_conta.reading add primary key ( id, read_date_time );

GRANT CREATE, USAGE ON SCHEMA dwh_conta TO ga_balvi;
GRANT CREATE, USAGE ON SCHEMA dwh_conta TO goaigua_nifi;
GRANT UPDATE, TRUNCATE, REFERENCES, INSERT, DELETE, TRIGGER, SELECT ON TABLE dwh_conta.reading TO ga_balvi;
GRANT UPDATE, TRUNCATE, REFERENCES, INSERT, DELETE, TRIGGER, SELECT ON TABLE dwh_conta.reading TO goaigua_nifi;

SELECT create_hypertable(
‘dwh_conta.reading’,
‘read_date_time’,
migrate_data => true,
chunk_time_interval => INTERVAL ‘1 day’,
associated_schema_name => ‘dwh_conta’,
associated_table_prefix => ‘reading’
);

Thanks in advance!"

This way, you’re inviting the forum members to provide more targeted assistance or advice based on your specific concerns. Overall, your post is on the right track!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 291

Trending Articles