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

Remove Postgres 11 support #1365

Merged
merged 17 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["postgres-11", "postgres-12", "postgres-13", "postgres-14", "postgres-15", "postgres-16"]
version: ["postgres-12", "postgres-13", "postgres-14", "postgres-15", "postgres-16"]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/will-it-blend-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false # We want all of them to run, even if one fails
matrix:
pg_version: ["pg11", "pg12", "pg13", "pg14", "pg15"]
pg_version: ["pg12", "pg13", "pg14", "pg15", "pg16"]
container: ["fedora", "debian_bullseye", "alpine_3.18", "amazon_2"]
steps:
- uses: actions/checkout@v3
Expand All @@ -40,7 +40,7 @@ jobs:
strategy:
fail-fast: false # We want all of them to run, even if one fails
matrix:
pg_version: ["pg11", "pg12", "pg13", "pg14", "pg15"]
pg_version: ["pg12", "pg13", "pg14", "pg15", "pg16"]
container: ["debian_bullseye"]
steps:
# See above for logic details here
Expand Down
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cargo-pgrx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ serde_derive = "1.0"
serde-xml-rs = "0.6.0"
syn = { version = "2.0.18", features = [ "extra-traits", "full", "fold", "parsing" ] }
unescape = "0.1.0"
fork = "0.1.22"
libloading = "0.8.1"
object = "0.32.1"
once_cell = "1.18.0"
Expand Down
446 changes: 149 additions & 297 deletions cargo-pgrx/README.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire file has a bunch of README changes in which I actually ran the command and pasted in what I saw.

In many cases the output had diverged, significantly. It might be a good idea to think about a better way to keep these synced.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cargo-pgrx/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ lib
, naersk
, hostPlatform
, postgresql_11
, postgresql_12
, postgresql_13
, postgresql_14
, pkg-config
, openssl
, rustfmt
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::path::PathBuf;
#[derive(clap::Args, Debug)]
#[clap(author)]
pub(crate) struct Connect {
/// Do you want to run against Postgres `pg11`, `pg12`, `pg13`, `pg14`, `pg15`?
/// Do you want to run against pg12, pg13, pg14, pg15, or pg16?
#[clap(env = "PG_VERSION")]
pg_version: Option<String>,
/// The database to connect to (and create if the first time). Defaults to a database with the same name as the current extension name
Expand Down
6 changes: 0 additions & 6 deletions cargo-pgrx/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ static PROCESS_ENV_DENYLIST: &'static [&'static str] = &[
#[derive(clap::Args, Debug)]
#[clap(author)]
pub(crate) struct Init {
/// If installed locally, the path to PG11's `pgconfig` tool, or `download` to have pgrx download/compile/install it
#[clap(env = "PG11_PG_CONFIG", long)]
pg11: Option<String>,
/// If installed locally, the path to PG12's `pgconfig` tool, or `download` to have pgrx download/compile/install it
#[clap(env = "PG12_PG_CONFIG", long)]
pg12: Option<String>,
Expand Down Expand Up @@ -102,9 +99,6 @@ impl CommandExecute for Init {

let mut versions = HashMap::new();

if let Some(ref version) = self.pg11 {
versions.insert("pg11", version.clone());
}
if let Some(ref version) = self.pg12 {
versions.insert("pg12", version.clone());
}
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::process::Command;
#[derive(clap::Args, Debug)]
#[clap(author)]
pub(crate) struct Run {
/// Do you want to run against Postgres `pg11`, `pg12`, `pg13`, `pg14`, `pg15`?
/// Do you want to run against pg12, pg13, pg14, pg15, or pg16?
#[clap(env = "PG_VERSION")]
pg_version: Option<String>,
/// The database to connect to (and create if the first time). Defaults to a database with the same name as the current extension name
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub(crate) struct Schema {
/// Build in test mode (for `cargo pgrx test`)
#[clap(long)]
test: bool,
/// Do you want to run against Postgres `pg11`, `pg12`, `pg13`, `pg14`, `pg15`?
/// Do you want to run against pg12, pg13, pg14, pg15, or pg16?
pg_version: Option<String>,
/// Compile for release mode (default is debug)
#[clap(long, short)]
Expand Down
36 changes: 10 additions & 26 deletions cargo-pgrx/src/command/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ use crate::CommandExecute;
use eyre::eyre;
use owo_colors::OwoColorize;
use pgrx_pg_config::{PgConfig, PgConfigSelector, Pgrx};
use std::os::unix::process::CommandExt;
use std::path::PathBuf;
use std::process::Stdio;

/// Start a pgrx-managed Postgres instance
#[derive(clap::Args, Debug, Clone)]
#[clap(author)]
pub(crate) struct Start {
/// The Postgres version to start (`pg11`, `pg12`, `pg13`, `pg14`, `pg15`, or `all`)
/// The Postgres version to stop (pg12, pg13, pg14, pg15, pg16, or all)
#[clap(env = "PG_VERSION")]
pg_version: Option<String>,
#[clap(from_global, action = ArgAction::Count)]
Expand Down Expand Up @@ -87,30 +86,15 @@ pub(crate) fn start_postgres(pg_config: &PgConfig) -> eyre::Result<()> {
port.to_string().bold().cyan()
);
let mut command = std::process::Command::new(format!("{}/pg_ctl", bindir.display()));
// Unsafe block is for the pre_exec setsid call below
//
// This is to work around a bug in PG11 which does not call setsid in pg_ctl
// This means that when cargo pgrx run dumps a user into psql, pushing ctrl-c will abort
// the postgres server started by pgrx
unsafe {
command
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.arg("start")
.arg(format!(
"-o -i -p {} -c unix_socket_directories={}",
port,
Pgrx::home()?.display()
))
.arg("-D")
.arg(&datadir)
.arg("-l")
.arg(&logfile)
.pre_exec(|| {
fork::setsid().expect("setsid call failed for pg_ctl");
Ok(())
});
}
command
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.arg("start")
.arg(format!("-o -i -p {} -c unix_socket_directories={}", port, Pgrx::home()?.display()))
.arg("-D")
.arg(&datadir)
.arg("-l")
.arg(&logfile);

let command_str = format!("{:?}", command);
let output = command.output()?;
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::process::Stdio;
#[derive(clap::Args, Debug, Clone)]
#[clap(author)]
pub(crate) struct Stop {
/// The Postgres version to stop (`pg11`, `pg12`, `pg13`, `pg14`, `pg15`, or `all`)
/// The Postgres version to stop (pg12, pg13, pg14, pg15, pg16, or all)
#[clap(env = "PG_VERSION")]
pg_version: Option<String>,
#[clap(from_global, action = ArgAction::Count)]
Expand Down
2 changes: 1 addition & 1 deletion cargo-pgrx/src/command/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::CommandExecute;
#[derive(clap::Args, Debug, Clone)]
#[clap(author)]
pub(crate) struct Test {
/// Do you want to run against Postgres `pg11`, `pg12`, `pg13`, `pg14`, `pg15`, or `all`?
/// Do you want to run against pg12, pg13, pg14, pg15, pg16, or all?
#[clap(env = "PG_VERSION")]
pg_version: Option<String>,
/// If specified, only run tests containing this string in their names
Expand Down
1 change: 0 additions & 1 deletion cargo-pgrx/src/templates/cargo_toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
in
pkgs.mkShell {
inputsFrom = with pkgs; [
postgresql_11
postgresql_12
postgresql_13
postgresql_14
Expand Down
1 change: 0 additions & 1 deletion nix/templates/default/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/aggregate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/arrays/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/bad_ideas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/bgworker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/bytea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/composite_type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/custom_libname/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ name = "other_name"

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/custom_sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/custom_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/datetime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
2 changes: 1 addition & 1 deletion pgrx-examples/datetime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn to_iso_string(tsz: TimestampWithTimeZone) -> String {
/// EDT | 2023-05-19T12:38:06.343021-04:00
/// UTC | 2023-05-19T16:38:06.343021+00:00
/// ```
#[cfg(not(any(feature = "pg11", feature = "pg12")))]
#[cfg(not(any(feature = "pg12")))]
#[pg_extern(name = "to_iso_string", immutable, parallel_safe)]
fn to_iso_string_at_timezone(
tsz: TimestampWithTimeZone,
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/nostd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/numeric/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/operators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/pgtrybuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/range/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/schemas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/shmem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/spi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
2 changes: 0 additions & 2 deletions pgrx-examples/spi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ fn spi_return_query() -> Result<
>,
spi::Error,
> {
#[cfg(feature = "pg11")]
let query = "SELECT oid, relname::text || '-pg11' FROM pg_class";
#[cfg(feature = "pg12")]
let query = "SELECT oid, relname::text || '-pg12' FROM pg_class";
#[cfg(feature = "pg13")]
Expand Down
1 change: 0 additions & 1 deletion pgrx-examples/spi_srf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ crate-type = ["cdylib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
Expand Down
Loading