PostgreSQL version

Bart Koelman's Avatar

Bart Koelman

09 Nov, 2022 10:32 AM

Hi,

I'm trying to use the latest PostgreSQL version (15) on Windows/Ubuntu build workers.

- On Windows, the latest available version in the VS2022 image is v13. I've determined this by opening a remote desktop connection into the worker and looking into C:\Program Files\PostgreSQL.

- On Linux, despite having `stack: postgresql 13.4` in my appveyor.yml, when I run `psql --version` it always prints v15. It seems to completely ignore the version specified. (This is not much of a concern to me, just wanted to point this out.)

Looking at the documentation for Linux at https://www.appveyor.com/docs/linux-images-software/, it states that only PostgreSQL 13 is available, which is no longer correct. The Windows documentation at https://www.appveyor.com/docs/services-databases/#postgresql lists multiple versions, up to v13, which seems to be all that's available at this moment.

Could you please provide PostgreSQL v15 on Windows images as well?

In addition, it would be nice if there was a way on Windows to print the active PostgreSQL version, without knowing the full path (including version number) upfront. Today we have this:
```
    Write-Output "PostgreSQL version:"
    if ($IsWindows) {
        . "${env:ProgramFiles}\PostgreSQL\13\bin\psql" --version
    }
    else {
        psql --version
    }
```

  1. Support Staff 1 Posted by Feodor Fitsner on 09 Nov, 2022 06:09 PM

    Feodor Fitsner's Avatar

    Working on the update!

  2. Support Staff 2 Posted by Feodor Fitsner on 11 Nov, 2022 04:32 PM

    Feodor Fitsner's Avatar

    The latest versions of PostgreSQL 14 and 15 have been added to "Visual Studio 2022" image. Other versions bumped.
    https://www.appveyor.com/updates/2022/11/11/

  3. 3 Posted by Bart Koelman on 12 Nov, 2022 10:21 AM

    Bart Koelman's Avatar

    Thanks for the update. I'm trying to use PostgreSQL v15 on the updated Visual Studio 2022 image, but I can't access it from unit tests:

    [00:15:21] Starting test execution, please wait...
    [00:15:21] A total of 1 test files matched the specified pattern.
    [00:15:34] [xUnit.net 00:00:09.28]     NoEntityFrameworkTests.WorkItemTests.Can_delete_WorkItem [FAIL]
    [00:15:34]   Failed NoEntityFrameworkTests.WorkItemTests.Can_delete_WorkItem [5 s]
    [00:15:34]   Error Message:
    [00:15:34]    Npgsql.NpgsqlException : Failed to connect to 127.0.0.1:5432
    [00:15:34] ---- System.Net.Sockets.SocketException : No connection could be made because the target machine actively refused it.
    
    My PR is at https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1215/files and build output at https://ci.appveyor.com/project/json-api-dotnet/jsonapidotnetcore/b..., in case it helps.
  4. Support Staff 4 Posted by Feodor Fitsner on 14 Nov, 2022 02:34 AM

    Feodor Fitsner's Avatar

    AppVeyor Build Agent does not yet support PostgreSQL 15. You have to explicitly start its service somewhere before tests:

    install:
    - net start postgresql-x64-15
    
  5. 5 Posted by Bart Koelman on 15 Nov, 2022 07:21 AM

    Bart Koelman's Avatar

    It's working great now, thanks for your help!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac