COPY TABLE TO - Mailing list pgsql-hackers

From Paul Punett
Subject COPY TABLE TO
Date
Msg-id LEEEJFIHCGEJHMKLKOFBEEBKCAAA.paul.punett@shazamteam.com
Whole thread Raw
In response to Re: *sigh*  (Randolf Richardson <rr@8x.ca>)
Responses Re: COPY TABLE TO
Re: COPY TABLE TO
List pgsql-hackers
Hi,

I need to write a tab separated text file such that the first row contains
number of records in the table.
I insert first row with '0' (zero) as first column & rest columns NULL.
Then at the end of writing records to table I do a select into Variable
count(*) from table.
& update the first record with the count returned.
Unfortunately after the update the first row becomes the last row & hence
COPY TO FileName sends the count as the last record.

I need count as the first record? Any suggestions please ?
The documentation says indexing does not affect copy order.

I am developing on C++ with PostGre on windows. I need to port to Linux
later. Any suggestions on linking C++ code to PostGre (queries & functions)

Thanks
Paul



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE r ...
Next
From: Claudio Natoli
Date:
Subject: Re: [pgsql-hackers-win32] Current Win32 port status