COPY TABLE TO

From: "Paul Punett" <paul(dot)punett(at)shazamteam(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: COPY TABLE TO
Date: 2003-12-22 10:35:08
Message-ID: LEEEJFIHCGEJHMKLKOFBEEBKCAAA.paul.punett@shazamteam.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Re: *sigh* at 2003-12-12 19:43:55 from Randolf Richardson

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Claudio Natoli 2003-12-22 13:03:11 Re: Current Win32 port status
Previous Message Tatsuo Ishii 2003-12-22 08:57:20 Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE r ...