Skip to content

Commit

Permalink
ci: build and test with PostgreSQL 16
Browse files Browse the repository at this point in the history
Adding PGDLLEXPORT to symbols that need to be visible to PostgreSQL. For some
reason this did not fail in previous versions of PostgreSQL. Also, the
`debian/control` file is rebuilt to include PostgreSQL 16.
  • Loading branch information
mkindahl committed May 10, 2024
1 parent 6c7d43b commit 2b7017e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [13, 14, 15]
version: [13, 14, 15, 16]
container:
image: postgres:${{ matrix.version }}
steps:
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ sudo apt-get update
sudo apt-get -y install postgresql postgresql-server-dev-13
```

### Building from source

After the dependencies are installed, you can download the repository
from GitHub.

Expand All @@ -44,10 +46,7 @@ git clone [email protected]:mkindahl/pg_influx.git
cd pg_influx
```

### Building from source

After the dependencies are installed, To build and install the
extension:
To build and install the extension:

```bash
make
Expand All @@ -73,6 +72,15 @@ If you want to build unsigned packages, you can do that using
debmake -t -i "debuild -i -uc -us"
```

### Adding PostgreSQL versions

If a new version of PostgreSQL is supported, it is necessary to
rebuild the `debian/control` file from the `debian/control.in` file.

```bash
pg_buildext updatecontrol
```

## Running Regression Tests

To run the regression tests
Expand Down
8 changes: 8 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ Multi-Arch: foreign
Depends: ${misc:Depends}, ${postgresql:Depends}, ${shlibs:Depends}
Description: InfluxDB line protocol listener that can listen
on UDP ports and insert into PostgreSQL database tables.

Package: postgresql-16-pg-influx
Section: database
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${postgresql:Depends}, ${shlibs:Depends}
Description: InfluxDB line protocol listener that can listen
on UDP ports and insert into PostgreSQL database tables.
4 changes: 2 additions & 2 deletions influx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PG_MODULE_MAGIC;

PG_FUNCTION_INFO_V1(parse_influx);

void _PG_init(void);
void PGDLLEXPORT _PG_init(void);

/** Number of Influx protocol workers. */
static int InfluxWorkersCount;
Expand Down Expand Up @@ -141,7 +141,7 @@ Datum parse_influx(PG_FUNCTION_ARGS) {
if (tuple == NULL)
SRF_RETURN_DONE(funcctx);

SRF_RETURN_NEXT(funcctx, PointerGetDatum(HeapTupleGetDatum(tuple)));
SRF_RETURN_NEXT(funcctx, HeapTupleGetDatum(tuple));
}

static void StartBackgroundWorkers(const char *database_name,
Expand Down
3 changes: 2 additions & 1 deletion worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ typedef struct WorkerArgs {
} WorkerArgs;

void InfluxWorkerInit(BackgroundWorker *worker, WorkerArgs *args);
void InfluxWorkerMain(Datum dbid) pg_attribute_noreturn();

void PGDLLEXPORT InfluxWorkerMain(Datum dbid) pg_attribute_noreturn();

#endif /* WORKER_H_ */

0 comments on commit 2b7017e

Please sign in to comment.