Create extension fail : kindly help

Dear Sir/Madam,

I’m new to timescaledb and now I try to install timescaledb to my postgreSQL

Error shows up when I create the extension using following syntax using psql:
CREATE EXTENSION IF NOT EXISTS timescaledb;

ERROR:
could not load library “C:/Program Files/PostgreSQL/15/lib/timescaledb-2.11.0.dll”: The specified module could not be found.

NOTE:
I’m using postgreSQL 15.3 and try to install timescaledb 2.11
My OS is **windows 11 **

Hi, is there any chance to try to run via docker ? I think that’s the easiest way to run on windows.

Dear Sir/Madam,

I’m also new to timescaledb and now I try to install timescaledb to my postgreSQL

Error shows up when I migrate my sql file using following syntax using prisma :

npx prisma migrate dev

Error: P3006

Migration 20230622045150_init failed to apply cleanly to the shadow database.
Error:
db error: ERREUR: n’a pas pu charger la bibliothèque « C:/Program Files/PostgreSQL/15/lib/timescaledb-2.11.0.dll » : unknown error 126
0: sql_schema_connector::validate_migrations
with namespaces=None
at schema-engine\connectors\sql-schema-connector\src\lib.rs:301
1: schema_core::state::DevDiagnostic
at schema-engine\core\src\state.rs:266

Everything on windows…
I’ll try docker…

Thanks @richarddzk! Docker will be the shortest path to give a try locally. Also, you can give a try to our cloud, we have 30 days trial and just use it :slight_smile:

Also, another core member shared this info:

A missing OpenSSL 1.1 library (see the prerequisites for windows) often causes this issue. It might be a good idea to check whether or not the system currently has this particular version of OpenSSL installed.

OpenSSL builds for windows can be found here: Binaries - OpenSSLWiki

Thx for you answer, I’ll switch to docker I already have OpenSSL.

1 Like

Hi,

I switch to docker everything is up and works well I have my pgadmin I am able to create my model insert data etc.
I’m even able to connect Hasura image to my db.

There is my docker compose

version: '3.7'
services:
  # TimescaleDB/PostgreSQL database
  timescale:
    image: timescale/timescaledb:latest-pg12
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - type: volume
        source: timescale_volume # the volume name
        target: /var/lib/postgresql/data # the location in the container where the data is stored
        read_only: false
    ports:
      - 0.0.0.0:5432:5432
    networks:
      - timescale_network

  # PGAdmin for administering the TimescaleDB/PostgreSQL database with SQL
  pgadmin:
    image: "dpage/pgadmin4:latest"
    restart: unless-stopped
    env_file:
      - .env
    environment:
      PGADMIN_LISTEN_PORT: 9000
    ports:
      # Use 0.0.0.0 to make this DB admin app accessible from "http://localhost:9000"
      - 0.0.0.0:9000:9000
    volumes:
      # So the database server settings get saved and stored even if the container is replaced or deleted
      - pgadmin:/var/lib/pgadmin
    networks:
      - timescale_network
    
  graphql-engine:
    image: hasura/graphql-engine:v2.25.0

    ports:
    - "8080:8080"
    depends_on:
    - "timescale"
    restart: always
    environment:
      HASURA_GRAPHQL_DATABASE_URL: postgres://admin:xxxxxxxxxxx@timescale:5432/postgres
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
    networks:
      - timescale_network

networks:
  # The network the above containers share, for accessing the database
  timescale_network:

# Creates a named volume to persist our database data
volumes:
  helheim:
  timescale_volume:
  pgadmin:
    

Now I would like to create engine with sqlAlchemy or even psycopg2 and I get the following errors :

CONNECTION = "dbname=dbname user=admin password=xxxxxxxx host=timescale port=5432 sslmode=require"
with psycopg2.connect(CONNECTION) as conn:
            cursor = conn.cursor()

OperationalError: could not translate host name "timescale" to address: Host name lookup failure

or with

engine = sa.create_engine('postgresql+psycopg2://admin:xxxxxxxxx@timescale:5432?sslmode=require', echo=True)
        connection = engine.connect()

OperationalError: (psycopg2.OperationalError) could not translate host name "timescale" to address: Host name lookup failure (Background on this error at: https://sqlalche.me/e/20/e3q8)

SQLAlchemy: 2.0.17
psycopg2: 2.9.6

I also try connect my mage-ai pipeline to my timescaleDB the connection seems to by unstable with the native connector.


@data_loader
def load_data_from_postgres(*args, **kwargs):
    """
    Template for loading data from a PostgreSQL database.
    Specify your configuration settings in 'io_config.yaml'.

    Docs: https://docs.mage.ai/design/data-loading#postgresql
    """
    query = 'SELECT * FROM public."Underlyings" ORDER BY id ASC '  # Specify your SQL query here
    config_path = path.join(get_repo_path(), 'io_config.yaml')
   
    config_profile = 'default'

    with Postgres.with_config(ConfigFileLoader(config_path, config_profile)) as loader:
        return loader.load(query)

~\.conda\envs\ymir\lib\site-packages\mage_ai\io\base.py in conn(self)

    330             return self._ctx

    331         except AttributeError:

--> 332             raise ConnectionError(

    333                 'No connection currently open. Open a new connection to access this property.'

    334             )
ConnectionError: No connection currently open. Open a new connection to access this property.
Mage-ai io_config.yaml
  POSTGRES_CONNECT_TIMEOUT: 10
  POSTGRES_DBNAME: postgres
  POSTGRES_SCHEMA: public # Optional
  POSTGRES_USER: admin
  POSTGRES_PASSWORD: ********
  POSTGRES_HOST: timescale
  POSTGRES_PORT: 5432

mage-ai 0.8.98

Sorry for this newbie error, but i try to find out solution in google nothing solve it yet. I think something block the connection from outside the docker but i checked my postgresql.conf inside my docker and
listen_addresses is set to ‘*’ so it should works…

Hi Richard, you’re welcome.

Try to substitute timescale with 0.0.0.0 in the host name. Because that’s what you’re exporting in the docker. Timescale is just an internal name available in the network used by docker internals.

This timescale:5432 should become 0.0.0.0:5432