Binary mode copy in from stdin - Mailing list pgsql-hackers

From Dann Corbit
Subject Binary mode copy in from stdin
Date
Msg-id D425483C2C5C9F49B5B7A41F89441547010006F7@postal.corporate.connx.com
Whole thread Raw
Responses Re: Binary mode copy in from stdin  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">We have (among other things) and ODBC/OLEDB/JDBC/.NET driver for PostgreSQL and we want to optimize
fastmode insert/select behavior.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">When we try to do a binary mode copy from standard input, we get an error message that we can’t do
it.</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">How can we programmatically insert data using COPY from our own data stream without creating a
file.</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">In our case, creating a file is just plain stupid.  There is never any reason for the data to hit
thedisk except at write time.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">In case you were wondering, we already have the data in the correct binary format.</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Why was it decided that binary mode is not allowed for stdin or stdout?  After all, programs can
pipeto stdin and stdout.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font></div>

pgsql-hackers by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: COPYable logs status
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Autovacuum launcher doesn't notice death of postmaster immediately