Hi,
Are there any methods to connect to a database (say postgresql) using C?
Thanks,
Angshu
Hi,
Are there any methods to connect to a database (say postgresql) using C?
Thanks,
Angshu
also google for ODBC, which is probably the most common way.
postgresql's homepage has an ODBC driver which you can download.
there are also docs for the c api to postgres
thank you google.
Originally Posted by xhi
If you use libpq (and I think it is pretty good, I work with it on a daily basis) you have to remember to use the PQclear call to free memory that PostgreSQL allocates on your behalf (usually results and connection pointers, PGres* and PGconn*) so that you eliminate memory leaks.
That's not always intuitive if you use the same pointer over and over again.
Good luck!
Please read the forum rules, and avoid bumping long-dead threads.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.