Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with terraform-provider-postgresql #39109

Open
robert-s-lee opened this issue Jul 26, 2019 · 10 comments
Open

compatibility with terraform-provider-postgresql #39109

robert-s-lee opened this issue Jul 26, 2019 · 10 comments
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-investigation Further steps needed to qualify. C-label will change. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@robert-s-lee
Copy link
Contributor

robert-s-lee commented Jul 26, 2019

Describe the problem

hashicorp/terraform-provider-postgresql#91 has details.

To Reproduce

Postgres provider runs select version();

On Postgres,

# select version();
                                                     version
------------------------------------------------------------------------------------------------------------------
 PostgreSQL 11.2 on x86_64-apple-darwin18.2.0, compiled by Apple LLVM version 10.0.0 (clang-1000.11.45.5), 64-bit
(1 row)

On CockroachDB,

# select version();
                                       version
--------------------------------------------------------------------------------------
 CockroachDB CCL v19.1.3 (x86_64-apple-darwin14, built 2019/07/08 18:19:30, go1.11.6)
(1 row)

Expected behavior

Jira issue: CRDB-5593

@awoods187
Copy link
Contributor

@timveil did you do anything here when you were using terraform?

@robert-s-lee
Copy link
Contributor Author

@bdarnell thoughts on forking https://github.com/terraform-providers/terraform-provider-postgresql to fix the issue. This is blocking the customer from using the standard production deployment testing. The customer and Hasipcorp are in favor of forking.

@bdarnell
Copy link
Contributor

bdarnell commented Aug 1, 2019

Yeah, forking seems like the right thing to do. If it were just the select version(), I'm pretty sure there are ways to make it work in both databases (select setting from pg_catalog.pg_settings where name='server_version'; should work in both), but I think there are enough differences that a cockroach-specific provider is going to be better.

@awoods187
Copy link
Contributor

Plus forking allows us to build upon this in the future. +1

@awoods187 awoods187 added C-investigation Further steps needed to qualify. C-label will change. A-sql-pgcompat Semantic compatibility with PostgreSQL labels Aug 30, 2019
@awoods187
Copy link
Contributor

@vy-ton can you take a look here?

@vy-ton
Copy link
Contributor

vy-ton commented Jun 24, 2020

@johnrk Can Deployment & Operations create a CockroachDB fork of the Terraform Postgres Provider? AppDev could then investigate any further Postgres compatibility issues.

@johnrk-zz johnrk-zz self-assigned this Jun 24, 2020
@aybabtme
Copy link
Contributor

aybabtme commented Apr 1, 2021

👋 I was wondering if there's plans to support this terraform provider, or to have a dedicated cockroachdb terraform provider? Creating databases, schema, roles, etc, using Terraform would be super helpful.

@johnrk-zz
Copy link

Hi @aybabtme, some users have had success using the Postgres Terraform provider with CockroachDB.

Have you happened to try that yet?

@rafiss rafiss added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 12, 2021
@jlinder jlinder assigned mwang1026 and unassigned johnrk-zz Jul 13, 2021
@mwang1026 mwang1026 assigned piyush-singh and unassigned mwang1026 Jul 13, 2021
@martinkubrak
Copy link

Hi, trying this postgreqsql provider I'm getting [ERROR] vertex "postgresql_database.test_db" error: could not get advisory lock for role root: pq: unknown function: pg_advisory_xact_lock() when trying postgresql_database resource. postgresql_role fails with [ERROR] vertex "postgresql_role.test_role" error: error creating role test_role: pq: at or near "connection": syntax error

I've set expected_version to "13.0.0" as per select setting from pg_catalog.pg_settings where name='server_version';

Has anyone had luck with the cyrilgdn/postgresql?

@kylepl
Copy link

kylepl commented Nov 7, 2023

I've only tested getting Role to work, but I've started a discussion at cyrilgdn/terraform-provider-postgresql#372, with the two versions available that you can build locally and install at your own risk:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-investigation Further steps needed to qualify. C-label will change. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests