Visual Studio Code and library libpq

Hello

How can I add libpq sample project to connect to postgresql database, can't add libpq-fe.h?


I previously installed vcpkg.




Can anyone help?



Parents
  • Hello

    Thank you for the answer.

    In the project, I want to send data to a postgresql database. The data I send is temperature and humidity from the sensor.

     https://www.farnell.com/datasheets/2773931.pdf

    In your answer, I understood that it is not possible to do it in the way I tried to do it.

    So do I have to somehow libpq a static library and then add it to the CMakeLists.txt file and then try to built it?

    But how can I make libpq a static library?

  • Hi,

    Libpq is a third party library which we do not support. You could ask for support from postgresql community. You could probably build libpq from the source, but there might be many dependencies for which we do not have support. Additionally, it is unlikely that it would work. Therefore, I do not think it would be good way forward. Another option is to implement communication protocol yourself which could communicate with your database. This may not be easy to implement yourself. Finally, you can set up a server which could connect to the database. You could use CoAP or MQTT for this purpose. You could use nRF9160 to connect to the server which would communicate with the database.

    Best regards,
    Dejan

Reply
  • Hi,

    Libpq is a third party library which we do not support. You could ask for support from postgresql community. You could probably build libpq from the source, but there might be many dependencies for which we do not have support. Additionally, it is unlikely that it would work. Therefore, I do not think it would be good way forward. Another option is to implement communication protocol yourself which could communicate with your database. This may not be easy to implement yourself. Finally, you can set up a server which could connect to the database. You could use CoAP or MQTT for this purpose. You could use nRF9160 to connect to the server which would communicate with the database.

    Best regards,
    Dejan

Children
No Data
Related