Go to file
Bruce Momjian 33766e680d Here's a patch against 7.1.3 that fixes a problem with sending larger
queries over non-blocking connections with libpq. "Larger" here
basically means that it doesn't fit into the output buffer.

The basic strategy is to fix pqFlush and pqPutBytes.

The problem with pqFlush as it stands now is that it returns EOF when an
error occurs or when not all data could be sent. The latter case is
clearly not an error for a non-blocking connection but the caller can't
distringuish it from an error very well.

The first part of the fix is therefore to fix pqFlush. This is done by
to renaming it to pqSendSome which only differs from pqFlush in its
return values to allow the caller to make the above distinction and a
new pqFlush which is implemented in terms of pqSendSome and behaves
exactly like the old pqFlush.

The second part of the fix modifies pqPutBytes to use pqSendSome instead
of pqFlush and to either send all the data or if not all data can be
sent on a non-blocking connection to at least put all data into the
output buffer, enlarging it if necessary. The callers of pqPutBytes
don't have to be changed because from their point of view pqPutBytes
behaves like before. It either succeeds in queueing all output data or
fails with an error.

I've also added a new API function PQsendSome which analogously to
PQflush just calls pqSendSome. Programs using non-blocking queries
should use this new function. The main difference is that this function
will have to be called repeatedly (calling select() properly in between)
until all data has been written.

AFAICT, the code in CVS HEAD hasn't changed with respect to non-blocking
queries and this fix should work there, too, but I haven't tested that
yet.

Bernhard Herzog
2002-03-05 05:20:12 +00:00
config Heimdal support (Kerberos V implementation from KTH) 2002-02-23 04:17:47 +00:00
contrib Try to make makefile actually work ... 2002-02-25 04:16:58 +00:00
doc Add: 2002-03-05 03:32:11 +00:00
src Here's a patch against 7.1.3 that fixes a problem with sending larger 2002-03-05 05:20:12 +00:00
aclocal.m4 Put the right runpath to libpq into the Perl module shared object on more 2001-08-26 22:28:04 +00:00
configure Heimdal support (Kerberos V implementation from KTH) 2002-02-23 04:17:47 +00:00
configure.in Heimdal support (Kerberos V implementation from KTH) 2002-02-23 04:17:47 +00:00
COPYRIGHT Better formatting 2001-12-19 18:53:47 +00:00
GNUmakefile.in /doc/src -> /doc for Peter. 2001-11-21 23:19:25 +00:00
HISTORY Consistend spelling for PL/pgSQL 2002-01-31 21:20:03 +00:00
INSTALL Rebuild from source. 2002-01-31 00:46:26 +00:00
Makefile Restructure the key include files per recent pghackers discussion: there 2001-02-10 02:31:31 +00:00
README New edition 2001-12-19 18:53:58 +00:00
register.txt Stamp 7.2 for release. 2002-02-03 21:00:09 +00:00

PostgreSQL Database Management System
=====================================
  
This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions.  This distribution also contains several language
bindings, including C, C++, Perl, Python, and Tcl, as well as drivers
for JDBC and ODBC.

See the file INSTALL for instructions on how to build and install
PostgreSQL.  That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system.  Changes between all PostgreSQL releases are recorded in the
file HISTORY.  Copyright and license information can be found in the
file COPYRIGHT.  A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software may be obtained at
ftp://ftp.postgresql.org/pub/.  For more information look at our web
site located at http://www.postgresql.org/.