Zoals voorgesteld door @Knud Larsen:
Eerst moet je libpq-dev . installeren .
Als het succesvol is geïnstalleerd, kunt u het bestand /usr/include/postgresql/libpq-fe.h zien
Voer daarna het commando uit:
sudo luarocks PGSQL_INCDIR=/usr/include/postgresql/ install luasql-postgres