Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Postgres Compatibility Issue with 11.6 #124

Open
miketwenty1 opened this issue Mar 10, 2020 · 2 comments
Open

Postgres Compatibility Issue with 11.6 #124

miketwenty1 opened this issue Mar 10, 2020 · 2 comments

Comments

@miketwenty1
Copy link

Hi there,

What am I doing wrong, I keep getting a compatibility issue

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
v0.12.20

Affected Resource(s)

provider "postgresql"
resource "postgresql_database"

Expected Behavior

create DB

Actual Behavior

Error

Error: Error initializing PostgreSQL client: error detecting capabilities: error PostgreSQL version: dial tcp :5432: connect: connection refused
   on <empty> line 0:
   (source code not available)

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:
db_engine_version = "11.6"

provider "postgresql" {
  host              = module.service_db.address
  port              = 5432
  username          = var.db_username
  password          = module.service_db.password
  expected_version  = var.db_engine_version
  connect_timeout   = 15
  sslmode           = "require"
  alias = "servicedb"
}
@miketwenty1
Copy link
Author

Taking out the alias made it work. It's unclear why this would fix the issue. Will leave this open for a while to see if anyone can chime in.

@kostyrev
Copy link

kostyrev commented Aug 17, 2020

I'm having kinda the same problem but with 10.7 as well.
with alias I get

Error: Error initializing PostgreSQL client: error detecting capabilities: error PostgreSQL version: dial tcp :5432: connect: connection refused
  required_providers {
    postgresql = {
      version = "1.7.1"
    }
  }
provider "postgresql" {
  alias     = "main"
  host      = var.postgres_main_host
  port      = var.postgres_main_port
  username  = var.postgres_main_username
  password  = var.postgres_main_password
  superuser = false
}

It's

> terraform version
Terraform v0.12.29
+ provider.postgresql v1.7.1
+ provider.vault v2.12.2

I've tried different provider.postgresql versions starting from 1.5.0

Only removing alias resolves the problem.
I'm running this code against 10.7 AWS RDS.
Specifying expected_version does not help either.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants