In PostgreSQL sometimes we replace a database, we rename the old when a create a new one, example:

  • Database: test
  • Rename database to: test-04-04 (date)
  • Create a newdatabase: test

Now we have a lot of databases named : test-"date" and its becoming hard to add database at pg_hba every time, is there a way to allow all database start with test like test* ?

  • 4
    Why no simply allow access to all databases through pg_hba.conf but remove the connect privilege through SQL for the users and databases in question?
    – user1822
    Apr 4, 2018 at 8:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.