fly-apps / postgres-ha

Postgres + Stolon for HA clusters as Fly apps.
Apache License 2.0
318 stars 131 forks source link

Postgres 15 #88

Open davidspiess opened 2 years ago

davidspiess commented 2 years ago

Since Postgres 15 was released recently, do you consider adding it in the near future? fly pg create --image-ref flyio/postgres:15

Thanks :)

KristerV commented 1 year ago

i created a new image and was messing around all day to get my DB to update. since it's staging i decided to destory it and create 15.2 from scratch. i started out with just creating a normal pg server.

to my surprise it created 15.2 itself! it used image flyio/postgres-flex:15.2@sha256:8e00d751bb9811bc8511d7129db2cc5a515449cf4a7def8f1d60faacb2be91c6 so perhaps this can be used to update also.

angryziber commented 1 year ago

Seems there is still no official Postgres 15 image...

davissp14 commented 1 year ago

The Postgres-flex implementation defaults to PG 15: https://github.com/fly-apps/postgres-flex/tree/master

As long as you're running a recent version of flyctl, you should be good.

bcomnes commented 1 year ago

How do I tell if my Fly Postgres app is running postgres-ha or Postgres-flex? Or more simply, when I run fly image update on my postgres app, it's just updating within the postgres 14 docker images. How do I get it switched to 15?

davissp14 commented 1 year ago

To see what image you're using, you can use:

fly image show --app <app-name>

If you want to move from Stolon -> Flex, your best bet is to use the fly pg import feature.

bcomnes commented 1 year ago

Cool thanks for the pointer! Looks like I'm running on stolon.

fly image show      
Image Details
MACHINE ID      REGISTRY                REPOSITORY      TAG     VERSION DIGEST                                                                  
e286e91ce6e686  registry-1.docker.io    flyio/postgres  14.6    v0.0.41 sha256:3c25db96357a78e827ca7dbbf4963089bdfcd48fb05a40cd82cfff5c61fb7710 
bcomnes commented 1 year ago

The process to migrate (for me) was approximately the following:

Note that this approach requires downtime. Shut down your app or put it into maintenance mode that prevents new writes.