On Tue, 2022-06-21 at 10:56 +0800, Rino Mardo wrote:
> hi. i found odbc.postgresql.org when i was looking for a way to hook up my c++ project to postgresql server.
> installed it and tested to be successful in connection. this was when i had postgresql
> running from a virtualbox vm in Ubuntu.
>
> i installed a postgresql container using Docker for Windows in my laptop. from a Windows terminal i can
> connect to the postgresql container and from there use psql client to create database.
>
> when postgresql was running in an Ubuntu vm in virtualbox, i wasn't able to test the c++ connection.
> now i want to but can't find a way how. either from python or any programming language.
>
> i guess my problem is more of the programming than db server side but i thought to try asking here
> in case someone can help. thanks.
I am surprised that you choose to be fettered by the constraints of a generic API like ODBC.
For me, that only makes sense if you want to be portable to different databases.
I would use the powerful C API of libpq, or, if you want some C++ boilerplate around it,
use libpqxx.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com