Re: COPY formatting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY formatting
Date: 2004-03-19 14:39:58
Message-ID: 23839.1079707198@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> writes:
>>> It's pity that main idea of current COPY is based on separated lines
>>> and it is not more common interface for streaming data between FE and BE.
>>
>> Yeah, that was another concern I had. This API would let the formatter
>> control line-level layout but it would not eliminate the hard-wired
>> significance of newline. What's worse, there isn't any clean way to
>> deal with reading quoted newlines --- the formatter can't really replace
>> the default quoting rules if the low-level code is going to decide
>> whether a newline is quoted or not.

> I think latest protocol version works with blocks of data and no with
> lines and client PQputCopyData() returns a block -- only docs says that
> it is row of table.

But you can't assume that the client will send blocks that are
semantically significant. For instance, if psql is reading a file to
send with \copy, how's it going to know how the file is formatted?
It's just gonna send disk-block-sized messages, and the backend has to
discover the semantic boundaries for itself.

> It sounds good, but I think we both not full sure about it now, right?
> CSV support will probably better add by DELIMITER extension.

Yeah, without people beating on our door for such a hook, it seems like
Andrew's DELIMITER idea is the best thing to do for now.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fernando Nasser 2004-03-19 14:49:23 Re: COPY formatting
Previous Message Larry Rosenman 2004-03-19 13:39:18 Re: [HACKERS] UnixWare/CVS Tip/initdb.c needs to use threads