timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.79k stars 884 forks source link

We have created a postgresql cluster with patroni, it is sucessfully created but when we i extends the database with timescaleDB using the command CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; But it gives an error, we have configured the file postgresql.conf by adding shared_preload_libraries = 'timescaledb' but still it is not working with patroni #1463

Closed Pravin-Pratiti closed 5 years ago

Pravin-Pratiti commented 5 years ago

Relevant system information:

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior A clear and concise description of what actually happened.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Pravin-Pratiti commented 5 years ago

The erro message is testdb=# CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; FATAL: extension "timescaledb" must be preloaded HINT: Please preload the timescaledb library via shared_preload_libraries. This can be done by editing the config file at: /data/patroni2/postgresql.conf and adding 'timescaledb' to the list in the shared_preload_libraries config.

Modify postgresql.conf:

shared_preload_libraries = 'timescaledb'

Another way to do this, if not preloading other libraries, is with the command: echo "shared_preload_libraries = 'timescaledb'" >> /data/patroni2/postgresql.conf (Will require a database restart.) If you REALLY know what you are doing and would like to load the library without preloading, you can disable this check with: SET timescaledb.allow_install_without_preload = 'on'; server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Succeeded.

k-rus commented 5 years ago

The issue was due to shared_preload_libraries needs to be set in Patroni configuration for PostgreSQL.

Pravin-Pratiti commented 5 years ago

thanks now it is working

shreeramk commented 4 years ago

@Pravin-kumbhar how you fixed it could you please explain?

If I manually add to postgresql.conf, on restarting patroni, it gets overwritten .

roshan5595 commented 4 years ago

@shreeramk Im running into the same scenario.

phungxuanvuong commented 3 years ago

The issue was due to shared_preload_libraries needs to be set in Patroni configuration for PostgreSQL.

How can Add shared_preload_libraries to postgresql

PotapenkoOleg commented 7 months ago

Add this in postgresql section (NOT DCS !)

Doc is here

postgresql:
  listen: 192.168.0.15432
  connect_address: 192.168.0.1:5432
  data_dir: /opt/postgres/16/data/
  bin_dir: /usr/pgsql-16/bin
  pgpass: /tmp/pgpass0
  authentication:
    replication:
      username: rep_user
      password: postgres
    superuser:
      username: postgres
      password: postgres
    rewind:
      username: rep_user
      password: postgres
  parameters:
    shared_preload_libraries: 'citus,pg_cron' # ADD EXTENSIONS HERE !!!
    unix_socket_directories: '/var/run/postgresql, /tmp'
    external_pid_file: '/var/run/postgresql/citus-patroni.pid'
    logging_collector: 'on'
    log_directory: '/opt/postgres/16/log'
    log_filename: 'citus-patroni.log'