Re: accessing postgres from c++

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: accessing postgres from c++
Дата
Msg-id d5161927b0fd2abf1f8981c691acae706c26f3a0.camel@cybertec.at
обсуждение исходный текст
Ответ на accessing postgres from c++  (Rino Mardo <rino19ny@gmail.com>)
Ответы Re: accessing postgres from c++  (Dominique Devienne <ddevienne@gmail.com>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Aditya Bhardwaj
Дата:
Сообщение: How to use 32 bit ODBC driver
Следующее
От: Dominique Devienne
Дата:
Сообщение: Re: accessing postgres from c++