aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-exec.c
Commit message (Collapse)AuthorAge
...
* Fix PQescapeBytea/PQunescapeBytea so that they handle bytes > 0x7f.Tatsuo Ishii2002-04-08
| | | | | | This is necessary for mulibyte character sequences. See "[HACKERS] PQescapeBytea is not multibyte aware" thread posted around 2002/04/05 for more details.
* Change made to elog:Bruce Momjian2002-03-06
| | | | | | | | | | | | | | | | | | | o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
* Back out old version and update with newer patch of:Bruce Momjian2002-03-05
| | | | | | Fix for non-blocking connections in libpq Bernhard Herzog
* Here's a patch against 7.1.3 that fixes a problem with sending largerBruce Momjian2002-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add PQunescapeBytea libpq function.Bruce Momjian2002-03-04
| | | | | | Everyone using libpq and bytea is probably having to invent this wheel.. Patrick Welche
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* > Here's a revised patch. Changes:Bruce Momjian2001-09-14
| | | | | | | | | | | | | | | | | | | | | | | | > > 1. Now outputs '\\' instead of '\134' when using encode(bytea, 'escape') > Note that I ended up leaving \0 as \000 so that there are no ambiguities > when decoding something like, for example, \0123. > > 2. Fixed bug in byteain which allowed input values which were not valid > octals (e.g. \789), to be parsed as if they were octals. > > Joe > Here's rev 2 of the bytea string support patch. Changes: 1. Added missing declaration for MatchBytea function 2. Added PQescapeBytea to fe-exec.c 3. Applies cleanly on cvs tip from this afternoon I'm hoping that someone can review/approve/apply this before beta starts, so I guess I'd vote (not that it counts for much) to delay beta a few days :-) Joe Conway
* > I found a problem with PQescapeString (I think). Since it escapesBruce Momjian2001-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | > null bytes to be literally '\0', the following can happen: > 1. User inputs string value as "<null byte>##" where ## are digits in the > range of 0 to 7. > 2. PQescapeString converts this to "\0##" > 3. Escaped string is used in a context that causes "\0##" to be evaluated as > an octal escape sequence. I agree that this is a problem, though it is not possible to do anything harmful with it. In addition, it only occurs if there are any NUL characters in its input, which is very unlikely if you are using C strings. The patch below addresses the issue by removing escaping of \0 characters entirely. > If the goal is to "safely" encode null bytes, and preserve the rest of the > string as it was entered, I think the null bytes should be escaped as \\000 > (note that if you simply use \000 the same string truncation problem > occurs). We can't do that, this would require 4n + 1 bytes of storage for the result, breaking the interface. Florian Weimer
* I've attached the fixed version of the patch below. After theBruce Momjian2001-09-07
| | | | | | | | | | discussion on pgsql-hackers (especially the frightening memory dump in <12273.999562219@sss.pgh.pa.us>), we decided that it is best not to use identifiers from an untrusted source at all. Therefore, all claims of the suitability of PQescapeString() for identifiers have been removed. Florian Weimer
* Below is the patch against current cvs for libpgtcl andBruce Momjian2001-09-06
| | | | | | | | | two additional files win32.mak and libpgtcl.def. This patch allows to compile libpgtcl.dll on Windows with tcl > 8.0. I've tested it on WinNT (VC6.0), SUSE Linux (7.0) and Solaris 2.6 with tcl 8.3.3. Mikhail Terekhov
* > Ok, where's a "system dependent hack" :)Bruce Momjian2001-08-21
| | | | | | | | | | | | | | | | | | | | > It seems that win9x doesn't have the "netmsg.dll" so it defaults to "normal" > FormatMessage. > I wonder if one could load wsock32.dll or winsock.dll on those systems > instead of netmsg.dll. > > Mikhail, could you please test this code on your nt4 system? > Could someone else test this code on a win98/95 system? > > It works on win2k over here. It works on win2k here too but not on win98/95 or winNT. Anyway, attached is the patch which uses Magnus's my_sock_strerror function (renamed to winsock_strerror). The only difference is that I put the code to load and unload netmsg.dll in the libpqdll.c (is this OK Magnus?). Mikhail Terekhov
* Remove some unneeded dashes from libpq comments.Bruce Momjian2001-08-17
|
* Use MD5 for wire protocol encryption for >= 7.2 client/server.Bruce Momjian2001-08-15
| | | | | | | Allow pg_shadow to be MD5 encrypted. Add ENCRYPTED/UNENCRYPTED option to CREATE/ALTER user. Add password_encryption postgresql.conf option. Update wire protocol version to 2.1.
* Fix residual breakage from Windows socket-errno patch: the routinesTom Lane2001-08-03
| | | | that should use regular errno, not WSAGetLastError(), now do so again.
* i've spotted a following problem using DBD::Pg under win32. winsockBruce Momjian2001-07-20
| | | | | | | | | functions do not set errno, so some normal conditions are treated as fatal errors. e.g. fetching large tuples fails, as at some point recv() returns EWOULDBLOCK. here's a patch, which replaces errno with WSAGetLastError(). i've tried to to affect non-win32 code. Dmitry Yurtaev
* NLS for libpq. Clean up the message formats and change the documentationPeter Eisentraut2001-07-15
| | | | accordingly.
* Repair libpq to follow protocol by not sending Terminate messages beforePeter Eisentraut2001-07-06
| | | | | the startup exchange is complete. Also make sure that packets defined as single bytes aren't sent with a trailing '\0'.
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-10
| | | | | | | | | | | are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
* Now that I look at it, PQoidValue() ain't quite right either.Tom Lane2001-02-06
|
* Repair PQoidStatus() bug reported by darcy@druid.net.Tom Lane2001-02-06
|
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane2000-12-03
| | | | | values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
* Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut2000-06-14
| | | | | | | | | | | we'll get there one day. Use `cat' to create aclocal.m4, not `aclocal'. Some people don't have automake installed. Only run the autoconf rule in the top-level GNUmakefile if the invoker specified `make configure', don't run it automatically because of CVS timestamp skew.
* ! * Users doing non-blocking connections need to handle the resetBruce Momjian2000-05-25
| | | | | | | ! * themselves, they'll need to check the connection status if we ! * return an error. Alfred Perlstein
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Repair unintentional damage to MULTIBYTE code.Tom Lane2000-03-14
|
* Change PQconndefaults() to return a malloc'd array, instead of a staticTom Lane2000-03-11
| | | | | | | | array. This allows processing of conninfo strings to be made thread-safe, at the cost of a small memory leak in applications that use PQconndefaults() and are not updated to free the returned array via the new PQconninfoFree() function. But PQconndefaults() is probably not used very much, so this seems like a good compromise.
* Tweak libpq so that if a backend ERROR message arrives while libpqTom Lane2000-02-24
| | | | | | | | | | thinks the connection is idle, the error message is displayed as if it were a NOTICE. This seems better than dropping the message on the floor ... particularly if the message is the backend telling us why it's about to close the connection. The previous behavior was Backend message type 0x45 arrived while idle pqReadData() -- backend closed the channel unexpectedly. which is not real helpful.
* Fixed psql double quoting of SQL idsPeter Eisentraut2000-02-07
| | | | Fixed libpq printing functions
* Add:Bruce Momjian2000-01-26
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* Remove Ops parameter from STATRELID cache lookup, for Tom Lane andBruce Momjian2000-01-24
| | | | optimizer.
* Libpq non-blocking mode, from Alfred PerlsteinBruce Momjian2000-01-18
|
* In the spirit of TODO itemBruce Momjian1999-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add use of 'const' for varibles in source tree (which is misspelled, btw.) I went through the front-end libpq code and did so. This affects in particular the various accessor functions (such as PQdb() and PQgetvalue()) as well as, by necessity, the internal helpers they use. I have been really thorough in that regard, perhaps some people will find it annoying that things like char * foo = PQgetvalue(res, 0, 0) will generate a warning. On the other hand it _should_ generate one. This is no real compatibility break, although a few clients will have to be fixed to suppress warnings. (Which again would be in the spirit of the above TODO.) In addition I replaced some int's by size_t's and removed some warnings (and generated some new ones -- grmpf!). Also I rewrote PQoidStatus (so it actually honors the const!) and supplied a new function PQoidValue that returns a proper Oid type. This is only front-end stuff, none of the communicaton stuff was touched. The psql patch also adds some new consts to honor the new libpq situation, as well as fixes a fatal condition that resulted when using the -V (--version) option and there is no database listening. So, to summarize, the psql you should definitely put in (with or without the libpq). If you think I went too far with the const-mania in libpq, let me know and I'll make adjustments. If you approve it, I will also update the docs. -Peter -- Peter Eisentraut Sernanders vaeg 10:115
* Update frontend libpq to remove limits on query lengths,Tom Lane1999-08-31
| | | | | | | error/notice message lengths, and number of fields per tuple. Add pqexpbuffer.c/.h, a frontend version of backend's stringinfo module. This is first step in applying Mike Ansley's long-query patches, even though he didn't do any of these particular changes...
* Enable WIN32 compilation of libpq.Bruce Momjian1999-07-19
|
* Re-add getopt.h check, remove NT-specific tests for it.Bruce Momjian1999-07-19
|
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* When closure of the backend connection is detected during pqFlush,Tom Lane1999-05-28
| | | | | | | | do the right thing: look for a NOTICE message from the backend before we close our side of the socket. 6.4 libpq did not reliably print the backend's hara-kiri message, 'The Postmaster has informed me ...', because it only did the right thing if connection closure was detected during a read attempt instead of a write attempt.
* pgindent run over code.Bruce Momjian1999-05-25
|
* Fix bogus assumption that MAXALIGN is at least sizeof(pointer).Tom Lane1999-05-12
|
* Use MAXALIGN value found by configure instead of aTom Lane1999-04-04
| | | | hardwired assumption.
* Reversed out libpq protocol patch for Tom Lane.Bruce Momjian1999-03-14
|
* This is another example of why not allowing utility functions in SPIBruce Momjian1999-03-14
| | | | | | | | | | | | would be a Bad Thing. For what it's worth, I found another case in libpq where you can get a T message without a D that my utility patch needs to handle. I have attached the updated patch against the 6.4.2 version of src/interfaces/libpq/fe-exec.c Jerry Gay
* Hi,Bruce Momjian1999-03-14
| | | | | | | | | Just in case you'd like to see what I was talking about, I am attaching my patch to src/interfaces/libpq/fe-exec.c to prevent utility functions called from SPI from locking up the client. Jerry Gay
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Add PQresStatus() function to avoid direct access to pgresStatus[] array,Tom Lane1999-02-07
| | | | making life easier for Windoids...
* The libpq function PQfnumber does not handle case-insensitiveBruce Momjian1999-02-03
| | | | | | | | comparisons correctly. The psql monitor converts all table and field names to lower case. If the PQfnumber function is called with a mixed case name, it will always return -1. Bahman Rafatjoo
* Portability fix for old SunOS releases: realloc(NULL, ...)Tom Lane1998-11-29
| | | | doesn't work there.
* Performance improvement for libpq: avoid calling malloc separatelyTom Lane1998-11-18
| | | | for each field of each tuple. Makes more difference than you'd think...
* Update libpq to store an error message in PGresult, per pgsq-interfaces ↵Tom Lane1998-10-01
| | | | discussion of 21-Sep.