Re: convertion from mySQL (mysql_fetch_row) - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: convertion from mySQL (mysql_fetch_row)
Date
Msg-id b42b73150808221223h6c633f15o45ffd9a598844656@mail.gmail.com
Whole thread Raw
In response to convertion from mySQL (mysql_fetch_row)  ("Masis, Alexander \(US SSA\)" <alexander.masis@baesystems.com>)
List pgsql-hackers
On Fri, Aug 22, 2008 at 2:20 PM, Masis, Alexander (US SSA)
<alexander.masis@baesystems.com> wrote:
> People,
> I am converting  C++ code to Postgres.
> Need help on how to deal with mysql_fetch_row, mysql_store_result
> functions in Postgres? There should be some C/C++ code available for
> these things, I hope.
> Thanks,
> Alex.

http://www.postgresql.org/docs/8.3/interactive/libpq.html
in particular,
http://www.postgresql.org/docs/8.3/interactive/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO

The libpq API is slightly thicker than mysql, which essentially
returns char ** for MYSQL_ROW.

With pg, you have a lot of flexibility with how you send queries,
parameterized, asynchronous, prepared, etc.  For starters though you
want to look at PQexec which maps to (iirc) mysql_real_query, more or
less.

libpq has very nice handling of binary data -- the protocol has
ability to send and receive blobs (and other things) without escaping
-- which is nice.

merlin


pgsql-hackers by date:

Previous
From: "Masis, Alexander \(US SSA\)"
Date:
Subject: convertion from mySQL (mysql_fetch_row)
Next
From: Bruce Momjian
Date:
Subject: Re: CREATE CAST too strict?