Skip to content

Commit eb7d22a

Browse files
committed
Add pg17 and 18 support
Also fixes bug with latest pg15/16 for drop commands
1 parent cff6eba commit eb7d22a

16 files changed

Lines changed: 5982 additions & 19 deletions

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
pull_request:
3+
branches: [ master ]
4+
push:
5+
branches: "*" # remove after build script works
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
pg_version: ["11", "12", "13", "14", "15", "16", "17", "18"]
13+
from_version: ["2.2", "2.3"]
14+
steps:
15+
- uses: actions/checkout@v6
16+
- name: Remove default PostgreSQL
17+
run: |
18+
sudo apt-get remove -y postgresql-*
19+
- name: Install PostgreSQL
20+
run: |
21+
sudo install -d /usr/share/postgresql-common/pgdg
22+
sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
23+
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
24+
sudo apt-get update
25+
sudo apt-get install -y "postgresql-${{ matrix.pg_version }}" "postgresql-server-dev-${{ matrix.pg_version }}" "postgresql-${{ matrix.pg_version }}-pglogical"
26+
sudo pg_createcluster -p 5433 ${{ matrix.pg_version }} test
27+
sudo sh -c 'echo "shared_preload_libraries = 'pglogical'\nwal_level = 'logical'" >> /etc/postgresql/${{ matrix.pg_version }}/test/postgresql.conf'
28+
sudo systemctl start postgresql@${{ matrix.pg_version }}-test
29+
RUNNER_USERNAME=$(whoami)
30+
sudo -u postgres psql -p 5433 -c "CREATE USER $RUNNER_USERNAME WITH SUPERUSER"
31+
- name: Run tests
32+
env:
33+
FROMVERSION: ${{ matrix.from_version }}
34+
PGPORT: 5433
35+
run: |
36+
export PATH="/usr/lib/postgresql/${{ matrix.pg_version }}/bin:$PATH"
37+
make
38+
sudo make install
39+
make installcheck
40+
- name: Upload Results
41+
if: failure()
42+
uses: actions/upload-artifact@v6
43+
with:
44+
name: test-results-${{ matrix.pg_version }}-from-${{ matrix.from_version }}
45+
path: regression.*

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.so
2+
*.o
3+
*.dylib
4+
regression.diffs
5+
regression.out
6+
results

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ DATA = pgl_ddl_deploy--1.0.sql pgl_ddl_deploy--1.0--1.1.sql \
99
pgl_ddl_deploy--1.7.sql pgl_ddl_deploy--1.7--2.0.sql \
1010
pgl_ddl_deploy--2.0.sql pgl_ddl_deploy--2.0--2.1.sql \
1111
pgl_ddl_deploy--2.1.sql pgl_ddl_deploy--2.1--2.2.sql \
12-
pgl_ddl_deploy--2.2.sql
12+
pgl_ddl_deploy--2.2.sql pgl_ddl_deploy--2.2--2.3.sql \
13+
pgl_ddl_deploy--2.3.sql
1314
MODULES = pgl_ddl_deploy ddl_deparse
1415

1516
REGRESS := 01_create_ext 02_setup 03_add_configs 04_deploy 04_deploy_update \

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ https://innovation.enova.com/pursuing-postgres-ddl-replication/
3939

4040
# <a name="release_notes"></a>Release Notes
4141

42+
### Release 2.3
43+
Summary of changes:
44+
* Support for Postgres 17 & 18
45+
4246
### Release 2.2
4347
Summary of changes:
4448
* Support for Postgres 16

ddl_deparse.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
107107
strtype = "ADD OIDS (and recurse)";
108108
break;
109109
#endif
110-
#if PG_VERSION_NUM >= 120000
110+
#if PG_VERSION_NUM >= 120000 && PG_VERSION_NUM < 180000
111111
case AT_CheckNotNull:
112112
strtype = "CHECK NOT NULL";
113113
break;
@@ -134,6 +134,11 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
134134
strtype = "DROP CONSTRAINT (and recurse)";
135135
break;
136136
#endif
137+
#if PG_VERSION_NUM >= 170000
138+
case AT_SetExpression:
139+
strtype = "SET EXPRESSION";
140+
break;
141+
#endif
137142
#if PG_VERSION_NUM >= 160000
138143
case AT_DropExpression:
139144
strtype = "DROP EXPRESSION";

debian/changelog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
pgl-ddl-deploy (2.2.1-1) unstable; urgency=medium
1+
pgl-ddl-deploy (2.2.0-1) unstable; urgency=medium
2+
3+
* Support for Postgres 16
4+
5+
-- Jacob Burroughs <jburroughs@instructure.com> Wed, 8 Apr 2026 06:18:15 -0500
6+
7+
pgl-ddl-deploy (2.2.1-1) unstable; urgency=medium
28

39
* Fix 2.2 upgrade scripts
410

expected/01_create_ext.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Allow running regression suite with upgrade paths
2-
\set v `echo ${FROMVERSION:-2.2}`
2+
\set v `echo ${FROMVERSION:-2.3}`
33
SET client_min_messages = warning;
44
CREATE EXTENSION pglogical;
55
CREATE EXTENSION pgl_ddl_deploy VERSION :'v';

expected/29_create_ext.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Allow running regression suite with upgrade paths
2-
\set v `echo ${FROMVERSION:-2.2}`
2+
\set v `echo ${FROMVERSION:-2.3}`
33
SET client_min_messages = warning;
44
CREATE TEMP TABLE v AS
55
SELECT :'v'::TEXT AS num;

0 commit comments

Comments
 (0)