Re: COPY Hacks (WAS: RE: Postgresql vs SQLserver for this application ?) - Mailing list pgsql-performance

From Tom Lane
Subject Re: COPY Hacks (WAS: RE: Postgresql vs SQLserver for this application ?)
Date
Msg-id 5831.1112819233@sss.pgh.pa.us
Whole thread Raw
In response to COPY Hacks (WAS: RE: Postgresql vs SQLserver for this application ?)  (Mischa <mischa.Sandberg@telus.net>)
List pgsql-performance
Mischa <mischa.Sandberg@telus.net> writes:
> Using COPY ... FROM STDIN via the Perl DBI (DBD::Pg) interface,
> I accidentally strung together several \n-terminated input lines,
> and sent them to the server with a single "putline".

> To my (happy) surprise, I ended up with exactly that number of rows
> in the target table.

> Is this a bug?

No, it's the way it's supposed to work.  "putline" really just sends a
stream of data ... there's no semantic significance to the number of
putline calls you use to send the stream, only to the contents of the
stream.  (By the same token, it's unlikely that deliberately aggregating
such calls would be much of a win.)

            regards, tom lane

pgsql-performance by date:

Previous
From: "Dave Held"
Date:
Subject: Re: COPY Hacks (WAS: RE: Postgresql vs SQLserver for this application ?)
Next
From: Tom Lane
Date:
Subject: Re: Plan for relatively simple query seems to be very inefficient