Re: Copy command not writing complete data to text file

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Copy command not writing complete data to text file
Дата
Msg-id 20050922145236.GA96171@winnie.fuhr.org
обсуждение исходный текст
Ответ на Copy command not writing complete data to text file  ("Kevin Keith" <kevinrkeith@hotmail.com>)
Ответы Re: Copy command not writing complete data to text file
Список pgsql-admin
On Thu, Sep 22, 2005 at 08:27:00AM -0500, Kevin Keith wrote:
> The platform is Free BSD, Postgres version 7.4.5 and the program triggering
> the COPY command is a CGI script.

What language and API are you using?  In the next paragraph you
mention PQexec(), which implies C or C++ and libpq (some people
argue that a C/C++ program isn't a "script," so that word could be
misleading).

> I am copying out to a text files using PQexec - there are no more than 500
> records in the tables being copied. What is happening, is one instance of
> the COPY command is always stopping after dumping 16,384 bytes (16K) to the
> text file - the last record is always truncated (i.e. the if the table has
> 20 columns, the last record may only have 7 columns in the flat file).
> There is also no error returned in the program - to the program calling the
> copy command everything gives an appearance of working.

Could you post the code that does the COPY and error checking?
Better yet, a short but complete program that exhibits the problem.

> What makes this problem difficult to resolve is that if I run the exact
> same COPY command from the PSQL prompt, everything works with no problems.

Does the CGI program behave differently if you run it from the
command line instead of through the web server?

--
Michael Fuhr

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

Предыдущее
От: "Kevin Keith"
Дата:
Сообщение: Copy command not writing complete data to text file
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: pg_restore fails