ankane/pgsync · error · Error

libpq is too old. Upgrade it and run `gem install pg`

Error message

libpq is too old. Upgrade it and run `gem install pg`

What it means

Error "libpq is too old. Upgrade it and run `gem install pg`" thrown in ankane/pgsync.

Source

Thrown at lib/pgsync/data_source.rb:192

    private

    def concurrent_id
      [Process.pid, Thread.current.object_id]
    end

    def reconnect
      @conn.reset
      @concurrent_id = concurrent_id
    end

    def table_set
      @table_set ||= Set.new(tables)
    end

    def conninfo
      @conninfo ||= begin
        unless conn.respond_to?(:conninfo_hash)
          raise Error, "libpq is too old. Upgrade it and run `gem install pg`"
        end
        conn.conninfo_hash
      end
    end

    # for pg 1.4.4
    # https://github.com/ged/ruby-pg/issues/490
    def dedup_localhost(value)
      if conninfo[:host] == "localhost,localhost" && conninfo[:port].to_s.split(",").uniq.size == 1
        value.split(",")[0]
      else
        value
      end
    end
  end
end

View on GitHub (pinned to 57bdddf5db)

When it happens

Trigger: Thrown at lib/pgsync/data_source.rb:192 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ankane/pgsync@57bdddf5db (2026-08-23). Data as JSON: /api/errors/afd92d3421f4af83. Report an issue: GitHub.