Re: code example for PQgetCopyData

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Huber <DHuber(at)letourneautechnologies(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: code example for PQgetCopyData
Date: 2009-12-03 19:30:03
Message-ID: 12670.1259868603@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dave Huber <DHuber(at)letourneautechnologies(dot)com> writes:
> Does anybody have a snippet where they use PQgetCopyData? I must be calling it wrong as it keep crashing my program. I've attached my code below. I am writing this for a Code Interface Node in LabVIEW.

One thing you're missing is that you should check that the result from
the PQexec actually shows successful entry into COPY_OUT state.
But I think the crash is because you're confused about the indirection
level. buffer should be char *, not char **, and the argument ought to
be &buffer so that the function can assign to buffer.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Huber 2009-12-03 19:35:07 Re: code example for PQgetCopyData
Previous Message Josh Berkus 2009-12-03 18:50:06 Re: Catastrophic changes to PostgreSQL 8.4