小编Tea*_*orn的帖子

Timescale DB 未创建超表

我正在关注 timescaleDB 的教程.. https://docs.timescale.com/timescaledb/latest/how-to-guides/hypertables/create/#create-a-hypertable

但我无法创建超表..我已经成功安装了 postgres 和 timescale。为什么我不能制作超表?

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "log"
    "os"
    "runtime"
    "strconv"
    "sync"

    "github.com/jackc/pgx/v4/pgxpool"
)




    func main(){
    timeScaleDB()
    }
      

      
    func timeScaleDB(){
    
        psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+
        "password=%s dbname=%s sslmode=disable",
        host, port, user, password, dbname)
    
        ctx := context.Background()
        dbpool, err := pgxpool.Connect(ctx, psqlInfo)
        if err != nil {
            fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err)
            os.Exit(1)
        }
        defer dbpool.Close()

       
       queryCreatetable := `CREATE TABLE sample_table (
        time TIMESTAMPTZ NOT NULL,
        id INTEGER PRIMARY …
Run Code Online (Sandbox Code Playgroud)

go hypertable timescaledb

2
推荐指数
1
解决办法
1332
查看次数

标签 统计

go ×1

hypertable ×1

timescaledb ×1