tuple count and v3 functions in psql for COPY - Mailing list pgsql-patches

From Volkan YAZICI
Subject tuple count and v3 functions in psql for COPY
Date
Msg-id 20051218101317.GA548@alamut
Whole thread Raw
Responses Re: tuple count and v3 functions in psql for COPY
Re: tuple count and v3 functions in psql for COPY
List pgsql-patches
I tried to prepare a patch for these TODO items:
 - Have COPY return the number of rows loaded/unloaded?
 - Update [pg_dump and] psql to use the new COPY libpq API.

Added an "uint64 processed" to "struct CopyStateData". It's
incremented each time on a tuple send/receive made by
CopyTo/CopyFrom. Collected result is added to COPY command's
commandTag which can be gathered by PQcmdStatus(). (Also updated
PQcmdTuples() to work with it.)

When I tried to modify psql to print the COPY's commandTag, I found
that its implementation is really disorganized when we still use old
COPY commands. Thus replaced old COPY routines with the new ones.
(IMHO, modified design for the psql's COPY should work faster than
the previous. Because, in this patch, I don't read input one by one
with getc(). Just filled the buffer with fgets and made \r search
only in the first and last lines.)


Regards.

--
"We are the middle children of history, raised by television to believe
that someday we'll be millionaires and movie stars and rock stars, but
we won't. And we're just learning this fact," Tyler said. "So don't
fuck with us."

Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] Solaris cc compiler on amd: PostgreSQL does not
Next
From: Simon Riggs
Date:
Subject: Re: Single-Transaction Utility options