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

Add pgrowlocks to instructions for manually setting up databases #1207

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

matthew-white
Copy link
Member

If I run tests locally using a database that doesn't have pgrowlocks, I see an error message:

  task: s3
    s3 disabled
      ✔ uploadPending() should fail
      ✔ setFailedToPending() should fail
      ✔ getCount() should fail
    s3 enabled
      getCount()
error: function pgrowlocks(unknown) does not exist

...

Error: cannot count blobs by status due to missing PostgreSQL extension: PGROWLOCKS.

To install this extension, execute the following query in your PostgreSQL instance:

    CREATE EXTENSION IF NOT EXISTS pgrowlocks;

The instructions here are clear, and tests pass once I create the extension in my test database. However, I think it'd be worth preventing the error by creating the extensions at the time of database setup. The readme includes instructions to manually set up the databases, and this PR adds the CREATE EXTENSION statement from above to those instructions.

#1190 removed the CREATE EXTENSION from the migration, which I think makes a lot of sense. #1190 also removed it from the readme instructions, and that's the part that this PR reverts. The readme instructions are for setting up databases for local development and testing, and I think there's no harm in running CREATE EXTENSION IF NOT EXISTS in those environments. The readme instructions already assume that the user is permitted to CREATE USER and CREATE DATABASE.

lib/bin/create-docker-databases.js also runs CREATE EXTENSION IF NOT EXISTS pgrowlocks;. In a sense, this PR is updating the readme to match create-docker-databases.js.

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@matthew-white matthew-white merged commit 6b456d6 into master Oct 4, 2024
6 checks passed
@matthew-white matthew-white deleted the pgrowlocks-readme branch October 4, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants