summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-exec.c
AgeCommit message (Collapse)Author
2005-06-09Defend against omitted paramLengths[] array in PQsendQueryParams.Tom Lane
Per Volkan Yazici.
2005-04-29Backpatch BCC compile changes to 8.0.X for psql.Bruce Momjian
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-10-21Standardize on using the Min, Max, and Abs macros that are in our c.h file,Tom Lane
getting rid of numerous ad-hoc versions that have popped up in various places. Shortens code and avoids conflict with Windows min() and max() macros.
2004-10-18Add PQprepare/PQsendPrepared functions to libpq to support preparingTom Lane
statements without necessarily specifying the datatypes of their parameters. Abhijit Menon-Sen with some help from Tom Lane.
2004-10-16Remove dllist.c from libpq. It's overkill for what libpq needs; we canTom Lane
just stick a list-link into struct PGnotify instead. Result is a smaller faster and more robust library (mainly because we reduce the number of malloc's and free's involved in notify processing), plus less pollution of application link-symbol namespace.
2004-08-30Another pgindent run with lib typedefs added.Bruce Momjian
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-05-07Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane
conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
2004-03-14Fix error in termination of COPY IN mode when using V2 protocol.Tom Lane
Report and fix per ljb, 8-Mar-04.
2004-03-05libpq's query to get the OIDs of large-object support functions was notTom Lane
schema-safe. Make it so, and improve the internal support for knowledge of server version.
2003-12-28Avoid infinite loop if connection is lost during PQexecStart() orTom Lane
PQexecFinish(). Per report from Andreas Pflug.
2003-11-30Make PQescapeBytea and byteaout consistent with each other, andJoe Conway
octal escape all octets outside the range 0x20 to 0x7e. This fixes the problem pointed out by Sergey Yatskevich here: http://archives.postgresql.org/pgsql-bugs/2003-11/msg00140.php
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-10-31Minor cleanup of PQunescapeBytea(). Avoid unportable assumptions aboutTom Lane
behavior of malloc and realloc when request size is 0. Fix escape sequence recognizer so that only valid 3-digit octal sequences are treated as escape sequences ... isdigit() is not a correct test.
2003-10-19Adjust libpq to avoid deadlock when both client and server want to sendTom Lane
data, and both have filled the transmission buffers. One scenario where this can happen was illustrated here: http://archives.postgresql.org/pgsql-hackers/2003-04/msg00979.php
2003-10-04Document the always-true-but-previously-undocumented fact that PQfnumber()Tom Lane
will downcase the supplied field name unless it is double-quoted. Also, upgrade the routine's handling of double quotes to match the backend, in particular support doubled double quotes within quoted identifiers. Per pgsql-interfaces discussion a couple weeks ago.
2003-10-03Cause PQescapeString to stop processing at a null character, ratherTom Lane
than generating an invalid output string. Per observation and patch from Igor Shevchenko. Further code cleanup and documentation by Tom Lane.
2003-10-02Don't use 0 as a spelling of NULL.Tom Lane
2003-09-22Message wording improvementsPeter Eisentraut
2003-09-05Enable Win32 to compile libpq again, and enable SSL compiles on thatBruce Momjian
platform. Andreas Pflug
2003-08-27Share PG_DIAG_* macros between client and server and use them internally.Peter Eisentraut
2003-08-13libpq failed to cope with COPY FROM STDIN if the command was issuedTom Lane
via extended query protocol, because it sends Sync right after Execute without realizing that the command to be executed is COPY. There seems to be no reasonable way for it to realize that, either, so the best fix seems to be to make the backend ignore Sync during copy-in mode. Bit of a wart on the protocol, but little alternative. Also, libpq must send another Sync after terminating the COPY, if the command was issued via Execute.
2003-08-13Add PQexecPrepared() and PQsendQueryPrepared() functions, to allowTom Lane
libpq users to perform Bind/Execute of previously prepared statements. Per yesterday's discussion, this offers enough performance improvement to justify bending the 'no new features during beta' rule.
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-08-04pgindent run.Bruce Momjian
2003-06-28When using new protocol, PQexec can get out of a COPY IN or COPY OUTTom Lane
state by itself, so do so.
2003-06-23Change pqInternalNotice to accept a format string and args instead ofTom Lane
just a preformatted message; per suggestion by Sean Chittenden.
2003-06-21Update libpq to make new features of FE/BE protocol available toTom Lane
client applications. Some editorial work on libpq.sgml, too.
2003-06-12I found the libpq function PGunescapeBytea a little slow. It was taking aBruce Momjian
minute and a half to decode a 500Kb on a fairly fast machine. I think the culprit is sscanf. I attach a patch that replaces the function with one used to perform the same task in pyPgSQL (a Python interface to PostgreSQL). This code was written by Billy Allie, author of pyPgSQL. I've changed a few variable names to match those in the original code and removed a bit of Pythonness. Billy has kindly looked at the code and points out that it is slightly stricter than the original implementation and if it encounters an invalid bytea such as '\12C' it drops the unescape '\' and outputs '12C'. The code is licensed by the author under a BSD license. I've performed limited testing of the function by putting JPEGs into PostgreSQL, extracting them using them using the new function and diffing against the original files. The new function is significantly faster on my machine with the JPEGs being decoded in less than a second. I attach a modified libpq example program that I used for my testing. Ben Lamb.
2003-06-08libpq can now talk to either 3.0 or 2.0 protocol servers. It first triesTom Lane
protocol 3, then falls back to 2 if postmaster rejects the startup packet with an old-format error message. A side benefit of the rewrite is that SSL-encrypted connections can now be made without blocking. (I think, anyway, but do not have a good way to test.)
2003-05-26Adjust error-handling logic in libpq. For the first time, libpq copesTom Lane
sanely with running out of memory for a query result.
2003-05-08Update 3.0 protocol support to match recent agreements about how toTom Lane
handle multiple 'formats' for data I/O. Restructure CommandDest and DestReceiver stuff one more time (it's finally starting to look a bit clean though). Code now matches latest 3.0 protocol document as far as message formats go --- but there is no support for binary I/O yet.
2003-04-26Add transaction status field to ReadyForQuery messages, and make roomTom Lane
for tableID/columnID in RowDescription. (The latter isn't really implemented yet though --- the backend always sends zeroes, and libpq just throws away the data.)
2003-04-25In the continuing saga of FE/BE protocol revisions, add reporting ofTom Lane
initial values and runtime changes in selected parameters. This gets rid of the need for an initial 'select pg_client_encoding()' query in libpq, bringing us back to one message transmitted in each direction for a standard connection startup. To allow server version to be sent using the same GUC mechanism that handles other parameters, invent the concept of a never-settable GUC parameter: you can 'show server_version' but it's not settable by any GUC input source. Create 'lc_collate' and 'lc_ctype' never-settable parameters so that people can find out these settings without need for pg_controldata. (These side ideas were all discussed some time ago in pgsql-hackers, but not yet implemented.)
2003-04-25Use closesocket() for all socket/pipe closing, because Win32 requiresBruce Momjian
it, and map that to close() on Unix.
2003-04-24Infrastructure for upgraded error reporting mechanism. elog.c isTom Lane
rewritten and the protocol is changed, but most elog calls are still elog calls. Also, we need to contemplate mechanisms for controlling all this functionality --- eg, how much stuff should appear in the postmaster log? And what API should libpq expose for it?
2003-04-22Another round of protocol changes. Backend-to-frontend messages now allTom Lane
have length words. COPY OUT reimplemented per new protocol: it doesn't need \. anymore, thank goodness. COPY BINARY to/from frontend works, at least as far as the backend is concerned --- libpq's PQgetline API is not up to snuff, and will have to be replaced with something that is null-safe. libpq uses message length words for performance improvement (no cycles wasted rescanning long messages), but not yet for error recovery.
2003-04-19Second round of FE/BE protocol changes. Frontend->backend messages nowTom Lane
have length counts, and COPY IN data is packetized into messages.
2003-03-25Use PQfreemem() consistently, and document its use for Notify.Bruce Momjian
Keep PQfreeNotify() around for binary compatibility.
2003-03-22Add PQfreemem() call for Win32.Bruce Momjian
2003-03-10This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane
PostgreSQL source code. Neil Conway
2003-02-19Allow PQcmdTuples to return row counts for MOVE and FETCH.Bruce Momjian
Neil Conway
2003-01-07Fix various places where global s/NOTICE/WARNING/ was applied with tooTom Lane
much enthusiasm.
2002-11-10I just discovered, that there is missing a const when passing a bufferBruce Momjian
to PQescapeBytea and PQunescapeBytea. I fixed it and tried to create a usable diff (I'm not so familar to diff). Tommi M?kitalo
2002-09-04pgindent run.Bruce Momjian
2002-08-24The cstring datatype can now be copied, passed around, etc. The typlenTom Lane
value '-2' is used to indicate a variable-width type whose width is computed as strlen(datum)+1. Everything that looks at typlen is updated except for array support, which Joe Conway is working on; at the moment it wouldn't work to try to create an array of cstring.
2002-06-20Update copyright to 2002.Bruce Momjian
2002-04-15Fix for NOTIFY when NAMEDATALEN is nonstandard in server. Fix idea fromBruce Momjian
Tom Lane to move string storage to end of structure but keep pointer in the same location.