X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BDDB3DA81F for ; Thu, 22 Sep 2005 11:52:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90027-03 for ; Thu, 22 Sep 2005 14:52:36 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 95546DA811 for ; Thu, 22 Sep 2005 11:52:37 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j8MEqbOr057045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Sep 2005 08:52:39 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j8MEqa4S096307; Thu, 22 Sep 2005 08:52:36 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j8MEqaur096306; Thu, 22 Sep 2005 08:52:36 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 22 Sep 2005 08:52:36 -0600 From: Michael Fuhr To: Kevin Keith Cc: pgsql-admin@postgresql.org Subject: Re: Copy command not writing complete data to text file Message-ID: <20050922145236.GA96171@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/233 X-Sequence-Number: 18970 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