Skip to content

Commit 6a5d1af

Browse files
committed
ci(postgres): pin testcontainer to postgres:16-alpine
The introspection query in `fetch_columns` reads `pg_attribute.attgenerated` (added in PG 12) to detect generated columns. testcontainers-modules' default tag for `Postgres::default()` is older than 12, so since the DDL UI feature landed every CI run has failed with `column a.attgenerated does not exist (SQLSTATE 42703)`. Pin the test container to 16-alpine. PostgreSQL 11 hit upstream EOL in November 2023, so requiring 12+ is reasonable for production deployments; not worth the per-version dialect branching to remain compatible with EOL versions.
1 parent 10735bb commit 6a5d1af

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

linux/crates/drivers/postgres/tests/integration.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@ use uuid::Uuid;
88
use drivers_postgres::PgDriver;
99
use tablepro_core::{ConnectOptions, Connection, DatabaseDriver, Value};
1010
use testcontainers::ContainerAsync;
11+
use testcontainers::ImageExt;
1112
use testcontainers_modules::postgres::Postgres;
1213
use testcontainers_modules::testcontainers::runners::AsyncRunner;
1314

1415
async fn start_pg() -> (ContainerAsync<Postgres>, ConnectOptions) {
15-
let container = Postgres::default().start().await.expect("start postgres container");
16+
// Pin to Postgres 16: the introspection query in `fetch_columns`
17+
// reads `pg_attribute.attgenerated`, which was added in PG 12.
18+
// testcontainers-modules's default tag is older and breaks the
19+
// generated-column flag query. PG 11 hit upstream EOL in Nov 2023
20+
// so production deployments shouldn't be older than this anyway.
21+
let container = Postgres::default()
22+
.with_tag("16-alpine")
23+
.start()
24+
.await
25+
.expect("start postgres container");
1626
let host = container.get_host().await.expect("host").to_string();
1727
let port = container.get_host_port_ipv4(5432).await.expect("port");
1828
let opts = ConnectOptions {

0 commit comments

Comments
 (0)