Skip to content
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
20 changes: 10 additions & 10 deletions etc/pgdump-to-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ From within this directory:
git clone https://github.com/jameshy/pgdump-aws-lambda.git lambda-src/pgdump-aws-lambda
```

Then copy the `postgres-17.5/` folder into `lambda-src/pgdump-aws-lambda/bin/`
Then copy the `postgres-17.7/` folder into `lambda-src/pgdump-aws-lambda/bin/`

Deploy:
```bash
Expand All @@ -16,29 +16,29 @@ sam build && sam deploy --resolve-s3 --config-env=staging

## Building Custom PostgreSQL Binaries (Optional)

This repository includes pre-built PostgreSQL 17.5 binaries for x86_64 architecture. If you need to build different versions or architectures:
This repository includes pre-built PostgreSQL 17.7 binaries for x86_64 architecture. If you need to build different versions or architectures:

### Using Docker (Recommended)

```bash
# Build PostgreSQL 17.5 binaries for x86_64 (Lambda compatible)
# Build PostgreSQL 17.7 binaries for x86_64 (Lambda compatible)
docker run -it --rm --platform linux/amd64 -v $(pwd):/workspace amazonlinux:2023 bash

# Inside the container:
dnf install -y make automake gcc gcc-c++ readline-devel zlib-devel openssl-devel libicu-devel wget tar gzip bison flex perl perl-FindBin

# Build PostgreSQL
wget https://ftp.postgresql.org/pub/source/v17.5/postgresql-17.5.tar.gz
tar zxf postgresql-17.5.tar.gz
cd postgresql-17.5
wget https://ftp.postgresql.org/pub/source/v17.7/postgresql-17.7.tar.gz
tar zxf postgresql-17.7.tar.gz
cd postgresql-17.7
./configure --with-ssl=openssl
make
make install DESTDIR=/workspace/postgres-build

# Copy binaries to project
mkdir -p /workspace/lambda-src/pgdump-aws-lambda/bin/postgres-17.5
cp /workspace/postgres-build/usr/local/pgsql/bin/pg_dump /workspace/lambda-src/pgdump-aws-lambda/bin/postgres-17.5/
cp /workspace/postgres-build/usr/local/pgsql/lib/libpq.so.5 /workspace/lambda-src/pgdump-aws-lambda/bin/postgres-17.5/
mkdir -p /workspace/lambda-src/pgdump-aws-lambda/bin/postgres-17.7
cp /workspace/postgres-build/usr/local/pgsql/bin/pg_dump /workspace/lambda-src/pgdump-aws-lambda/bin/postgres-17.7/
cp /workspace/postgres-build/usr/local/pgsql/lib/libpq.so.5 /workspace/lambda-src/pgdump-aws-lambda/bin/postgres-17.7/
```

### Using EC2 (Alternative)
Expand All @@ -56,5 +56,5 @@ After building custom binaries, update your `template.yml` to reference the new
In the `AuguryCron` target Input, add or update the `PGDUMP_PATH`:

```yaml
"PGDUMP_PATH": "bin/postgres-17.5"
"PGDUMP_PATH": "bin/postgres-17.7"
```
Binary file removed etc/pgdump-to-s3/postgres-17.5/libpq.so.5
Binary file not shown.
Binary file removed etc/pgdump-to-s3/postgres-17.5/pg_dump
Binary file not shown.
Binary file added etc/pgdump-to-s3/postgres-17.7/libpq.so.5
Binary file not shown.
Binary file added etc/pgdump-to-s3/postgres-17.7/pg_dump
Binary file not shown.
5 changes: 3 additions & 2 deletions etc/pgdump-to-s3/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Resources:
"PGDATABASE": "${DbName}",
"PGUSER": "${DbUser}",
"PGPASSWORD": "${DbPassword}",
"PGDUMP_PATH": "bin/postgres-17.5",
"PGDUMP_PATH": "bin/postgres-17.7",
"S3_REGION": "us-east-1",
"S3_BUCKET": "${PgdumpBucket}",
"ROOT": "daily/Augury",
Expand All @@ -182,7 +182,8 @@ Resources:
"--exclude-table-data=delayed_jobs",
"--exclude-table-data=forecast*",
"--exclude-table-data=inventory_log*",
"--exclude-table-data=sessions"
"--exclude-table-data=sessions",
"--exclude-table-data=ducklake_*"
]
}
AuguryCronInvokePermission:
Expand Down