Unable to publish function using postgres

Hi @stephen.zambaux,

Thanks for reporting this.

This appears to be a bug in libpq.
A workaround for this issue seems to be to install postgresql-dev.

The full log of the build (which was truncated due to a separate issue with logging) is:

gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@10.20.1 | linux | x64
gyp info find Python using Python version 2.7.12 found at "/opt/buildhome/python2.7/bin/python"
gyp http GET https://nodejs.org/download/release/v10.20.1/node-v10.20.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.20.1/node-v10.20.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.20.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.20.1/SHASUMS256.txt
gyp info spawn /opt/buildhome/python2.7/bin/python
gyp info spawn args [ '/opt/buildhome/.nvm/versions/node/v10.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/opt/build/repo/node_modules/libpq/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/opt/buildhome/.nvm/versions/node/v10.20.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/opt/buildhome/.cache/node-gyp/10.20.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/opt/buildhome/.cache/node-gyp/10.20.1',
gyp info spawn args '-Dnode_gyp_dir=/opt/buildhome/.nvm/versions/node/v10.20.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/opt/buildhome/.cache/node-gyp/10.20.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/opt/build/repo/node_modules/libpq',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
find: ‘/usr/pg*’: No such file or directory
gyp: Call to 'which pg_config || find /usr/bin /usr/local/bin /usr/pg* /opt -executable -name pg_config -print -quit' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/opt/buildhome/.nvm/versions/node/v10.20.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.14.138+
gyp ERR! command "/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node" "/opt/buildhome/.nvm/versions/node/v10.20.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/build/repo/node_modules/libpq
gyp ERR! node -v v10.20.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error during Yarn install
Error running command: Build script returned non-zero exit code: 1

As you can see the following line tries to find some files in /usr/pg* but none exist.