Re: code example for PQgetCopyData

Поиск
Список
Период
Сортировка
От Bret
Тема Re: code example for PQgetCopyData
Дата
Msg-id 000601ca7452$7bac9a50$0d00a8c0@bjsworkstation
обсуждение исходный текст
Ответ на Re: code example for PQgetCopyData  (Dave Huber <DHuber@letourneautechnologies.com>)
Список pgsql-general
Looks like fun.
 
Tom added some comments on the PQgetCopyData function.
 
If your environment allows, put a breapoint in on the line below  and look at the vars
 
while (nLen = PQgetCopyData(pConn, buffer, false) > 0)
 
perhaps this will get you working
while (nLen = PQgetCopyData(pConn, &buffer, false) > 0)
 
 
here's the only sample I found
 
 while (!copydone)
  {
! ret = PQgetCopyData(g_conn, &copybuf, false);
! switch (ret) {
! case -1:
! copydone = true;
! break;
! case 0:
! case -2:
! write_msg(NULL, "SQL command to dump the contents of table \"%s\" failed: PQgetCopyData() failed.\n", classname);
! write_msg(NULL, "Error message from server: %s", PQerrorMessage(g_conn));
! write_msg(NULL, "The command was: %s\n", q->data);
! exit_nicely();
! break;
! default:
! archputs(copybuf, fout);
! PQfreemem(copybuf);
! break;
  }


From: Dave Huber [mailto:DHuber@letourneautechnologies.com]
Sent: Thursday, December 03, 2009 11:35 AM
To: 'bret_stern@machinemanagement.com'; pgsql-general@postgresql.org
Subject: RE: [GENERAL] code example for PQgetCopyData

 

> Where is it blowing up?

 

I’m sorry, I wasn’t clear. It bombs on the PQgetCopyData call. If I comment out the entire while loop, the program runs fine. If I simply comment out the contents of the while loop…kablooey!

 

Dave



This electronic mail message is intended exclusively for the individual(s) or entity to which it is addressed. This message, together with any attachment, is confidential and may contain privileged information. Any unauthorized review, use, printing, retaining, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email message to the sender and delete all copies of this message.
THIS E-MAIL IS NOT AN OFFER OR ACCEPTANCE: Notwithstanding the Uniform Electronic Transactions Act or any other law of similar import, absent an express statement to the contrary contained in this e-mail, neither this e-mail nor any attachments are an offer or acceptance to enter into a contract, and are not intended to bind the sender, LeTourneau Technologies, Inc., or any of its subsidiaries, affiliates, or any other person or entity.
WARNING: Although the company has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.

 
 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Build universal binary on Mac OS X 10.6?
Следующее
От: Frank Sweetser
Дата:
Сообщение: Re: [Bacula-users] Catastrophic changes to PostgreSQL 8.4