From 21d86e3d6d62b70ffc9ecc22e651f15162c462f3 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 29 Nov 2021 07:29:22 +0100 Subject: [PATCH] fix build with postgresql 9 --- ext-src/swoole_postgres_coro.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ext-src/swoole_postgres_coro.cc b/ext-src/swoole_postgres_coro.cc index 06362e6f0..11e467225 100644 --- a/ext-src/swoole_postgres_coro.cc +++ b/ext-src/swoole_postgres_coro.cc @@ -539,6 +539,22 @@ static int meta_data_result_parse(PGObject *object) { return SW_OK; } +#ifndef PG_DIAG_SCHEMA_NAME +# define PG_DIAG_SCHEMA_NAME 's' +#endif +#ifndef PG_DIAG_TABLE_NAME +# define PG_DIAG_TABLE_NAME 't' +#endif +#ifndef PG_DIAG_COLUMN_NAME +# define PG_DIAG_COLUMN_NAME 'c' +#endif +#ifndef PG_DIAG_DATATYPE_NAME +# define PG_DIAG_DATATYPE_NAME 'd' +#endif +#ifndef PG_DIAG_CONSTRAINT_NAME +# define PG_DIAG_CONSTRAINT_NAME 'n' +#endif + static void set_error_diag(const PGObject *object, const PGresult *pgsql_result) { const unsigned int error_codes[] = {PG_DIAG_SEVERITY, PG_DIAG_SQLSTATE,