Can we specify postgres version when using the command flyctl postgres create

I need to see if I can specify postgres version while using this command?

@aahmadsaleem95 What version are you looking for?

@shaun I`m looking to deploy version 9.* like any of the 9 th version.

@aahmadsaleem95 Got it! You can certainly run Postgres 9 on Fly, but you would have to deploy it on your own. The automated tooling we provide for Postgres is not compatible with anything older than PG12.

Out of curiosity, what is the specific reason you’re looking for PG 9.*?

@shaun the reason for opting for PG 9.* it was specified by my lead and he wanted me to find a way through which I can deploy it on fly.io . So can you guide me like how can I deploy PG 9.* on fly.io like I have to specify it in my docker file or fly.toml. Because it needs to be created using fly.io?

While PG 9 is no longer supported by the community, you can still deploy it quite easily.

  1. Create a new app
fly app create --name <pg-app-name>
  1. Save the config file, you’ll use this to specify your mount information and build image.
fly config save --app <pg-app-name>
  1. Open up your fly.toml file and add the following:
[build]
  image = "postgres:9.6.24-bullseye"

[mounts]
source="pg_data"
destination="/data"

Additional images can be found in Dockerhub: Docker Hub

  1. Create your volume
fly volume create pg_data --size <size-gb> --region <region>
  1. Set your PG password as a secret
fly secrets set POSTGRES_PASSWORD=<pass>
  1. Deploy the app
fly deploy . 

That should do it.

@shaun thanks man.