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

Postgres 15 #88

Open
davidspiess opened this issue Oct 19, 2022 · 7 comments
Open

Postgres 15 #88

davidspiess opened this issue Oct 19, 2022 · 7 comments

Comments

@davidspiess
Copy link

davidspiess commented Oct 19, 2022

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
Copy link

KristerV commented Apr 3, 2023

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
Copy link

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

@davissp14
Copy link
Contributor

davissp14 commented Apr 14, 2023

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
Copy link

bcomnes commented May 23, 2023

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
Copy link
Contributor

davissp14 commented May 23, 2023

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
Copy link

bcomnes commented May 23, 2023

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
Copy link

bcomnes commented May 24, 2023

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

  • fly pg create a new Postgres instance. This is created with the new flex image.
  • fly pg import the old db to the new db.
  • fly secrets unset DATABASE_URL (detach didn't work for some reason)
  • flyctl postgres attach the new database
  • Update any other env vars that require database credentials.
  • Test a fly deploy on the app and ensure db credentials and migrations are working etc
  • Stop any machines on the old db instance

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

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

No branches or pull requests

5 participants