mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-24 08:30:37 +00:00
Use enum-typed PG versions
This makes it possible for the compiler to validate that a match block matched all PostgreSQL versions we support.
This commit is contained in:
@@ -31,6 +31,7 @@ use camino::{Utf8Path, Utf8PathBuf};
|
||||
use clap::{Parser, Subcommand};
|
||||
use compute_tools::extension_server::{PostgresMajorVersion, get_pg_version};
|
||||
use nix::unistd::Pid;
|
||||
use postgres_versioninfo::PgMajorVersion;
|
||||
use std::ops::Not;
|
||||
use tracing::{Instrument, error, info, info_span, warn};
|
||||
use utils::fs_ext::is_directory_empty;
|
||||
@@ -180,10 +181,10 @@ impl PostgresProcess {
|
||||
.context("create pgdata directory")?;
|
||||
|
||||
let pg_version = match get_pg_version(self.pgbin.as_ref()) {
|
||||
PostgresMajorVersion::V14 => 14,
|
||||
PostgresMajorVersion::V15 => 15,
|
||||
PostgresMajorVersion::V16 => 16,
|
||||
PostgresMajorVersion::V17 => 17,
|
||||
PostgresMajorVersion::V14 => PgMajorVersion::PG14,
|
||||
PostgresMajorVersion::V15 => PgMajorVersion::PG15,
|
||||
PostgresMajorVersion::V16 => PgMajorVersion::PG16,
|
||||
PostgresMajorVersion::V17 => PgMajorVersion::PG17,
|
||||
};
|
||||
postgres_initdb::do_run_initdb(postgres_initdb::RunInitdbArgs {
|
||||
superuser: initdb_user,
|
||||
|
||||
Reference in New Issue
Block a user