Re: COPY TABLE TO

Поиск
Список
Период
Сортировка
От Paulo Scardine
Тема Re: COPY TABLE TO
Дата
Msg-id 012101c3c8a0$d36e7560$6101a8c0@wxppaulos
обсуждение исходный текст
Ответ на COPY TABLE TO  ("Paul Punett" <paul.punett@shazamteam.com>)
Список pgsql-hackers
SELECT x, y
(SELECT 1 AS ord, COUNT(*) as x, NULL AS y FROM tablexUNIONSELECT 2, x, y FROM tablex)

May be you will have to do some explicit casting depending on the field
types.

--
Paulo Scardine

----- Original Message ----- 
From: "Paul Punett" <paul.punett@shazamteam.com>
To: <pgsql-hackers@postgresql.org>
Sent: Monday, December 22, 2003 8:35 AM
Subject: [HACKERS] COPY TABLE TO


> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>
>



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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE r ...