Skip site navigation (1) Skip section navigation (2)

tuple count and v3 functions in psql for COPY

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: pgsql-patches(at)postgresql(dot)org
Subject: tuple count and v3 functions in psql for COPY
Date: 2005-12-18 10:13:17
Message-ID: 20051218101317.GA548@alamut (view raw or flat)
Thread:
Lists: 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."

Responses

pgsql-patches by date

Next:From: Simon RiggsDate: 2005-12-18 18:55:26
Subject: Re: Single-Transaction Utility options
Previous:From: Karl O. PincDate: 2005-12-18 07:29:45
Subject: Re: Converting seconds past midnight to a time

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group