action-setup-postgres icon indicating copy to clipboard operation
action-setup-postgres copied to clipboard

Flexibility in postgres-version

Open bkoelman opened this issue 1 year ago • 4 comments

In v7, it seems impossible to keep the behavior that v6 provided: run the pre-installed version.

For my project, I don't care much which Postgres version is installed, and prefer to rely on the GitHub action images to ship with widely-tested versions instead of the latest (even if that varies per OS). What's worse: the duration of the action went from 7 to 30 seconds (on Ubuntu, Windows is likely much slower than that).

Can you provide the option default for postgres-version, which wouldn't install anything and just start what's preinstalled? And possibly latest, for users that don't care about the specific version number? That would fit with the idea of using hosted runner images, where the versions of software shift all the time.

bkoelman avatar Oct 29 '24 02:10 bkoelman

Hey @bkoelman,

I was thinking about something like this, but situation is tricky. It seems GitHub is slowly abandoning idea of shipping PostgreSQL with its runner images. Neither macOS 13 nor macOS 14 nor macOS 15 comes with pre-installed PostgreSQL, which means installation is a mandatory step for macOS runners.

Now let's take Ubuntu. The most recent version, 24.04, comes with PostgreSQL 16, while both 20.04 and 22.04 come with PostgreSQL 14. I agree that for some basic usage it doesn't matter at all, but it might become problematic who embrace most modern PostgreSQL features.

One of this action's driving principle is to make sure it sets up a homogenous environment, i.e. an environment that behaves identically (or at least tries to) across all three operating systems. At this moment, I'm not sure how can I achieve this without installation/reinstallation. :thinking:

I'm going to keep this ticket open and think about it more. For a time being, I recommend using v6 until it's addressed.

ikalnytskyi avatar Nov 02 '24 16:11 ikalnytskyi

It looks like v6 no longer works, since macos-latest switched to use macos-15 this month.

Image Image

Is there a workaround?

bkoelman avatar Aug 15 '25 19:08 bkoelman

@bkoelman This is the problem I was talking about. The only workaround that comes to mind is to suggest installing PostgreSQL yourself, using brew on macos-latest, before calling this action.

ikalnytskyi avatar Sep 13 '25 20:09 ikalnytskyi

I've switched to v7 since then, which works, but it increases the build time by 3 minutes and 11 seconds on Windows, which is very unfortunate.

This is where the default switch would help. If using default, use the pre-installed version, or install the default version used by this action if none is pre-installed.

bkoelman avatar Sep 14 '25 13:09 bkoelman