- 05 Mar, 2002 2 commits
-
-
Bruce Momjian authored
Fix for non-blocking connections in libpq Bernhard Herzog
-
Bruce Momjian authored
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
-
- 03 Dec, 2001 1 commit
-
-
Tom Lane authored
Magnus Hagander that DLL only contains error strings for the Net*** functions, *not* WinSock. We need to look for a workable solution for older Windows flavors ... but it won't happen for PG 7.2.
-
- 28 Nov, 2001 1 commit
-
-
Tom Lane authored
potential problems discussed in pgsql-interfaces.
-
- 27 Nov, 2001 1 commit
-
-
Tom Lane authored
-
- 08 Nov, 2001 2 commits
-
-
Bruce Momjian authored
-
Tom Lane authored
(surprised no one has reported these yet...)
-
- 05 Nov, 2001 1 commit
-
-
Bruce Momjian authored
initdb/regression tests pass.
-
- 28 Oct, 2001 1 commit
-
-
Bruce Momjian authored
spacing. Also adds space for one-line comments.
-
- 25 Oct, 2001 1 commit
-
-
Bruce Momjian authored
tests pass.
-
- 30 Sep, 2001 1 commit
-
-
Tom Lane authored
cleverer than it actually is ;-) Braces are good for you :-) Gerhard HÌring
-
- 06 Sep, 2001 2 commits
-
-
Tatsuo Ishii authored
------------------------------------------------------------------- Subject: Re: [PATCHES] encoding names From: Karel Zak <zakkr@zf.jcu.cz> To: Peter Eisentraut <peter_e@gmx.net> Cc: pgsql-patches <pgsql-patches@postgresql.org> Date: Fri, 31 Aug 2001 17:24:38 +0200 On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote: > > - convert encoding 'name' to 'id' > > I thought we decided not to add functions returning "new" names until we > know exactly what the new names should be, and pending schema Ok, the patch not to add functions. > better > > ...(): encoding name too long Fixed. I found new bug in command/variable.c in parse_client_encoding(), nobody probably never see this error: if (pg_set_client_encoding(encoding)) { elog(ERROR, "Conversion between %s and %s is not supported", value, GetDatabaseEncodingName()); } because pg_set_client_encoding() returns -1 for error and 0 as true. It's fixed too. IMHO it can be apply. Karel PS: * following files are renamed: src/utils/mb/Unicode/KOI8_to_utf8.map --> src/utils/mb/Unicode/koi8r_to_utf8.map src/utils/mb/Unicode/WIN_to_utf8.map --> src/utils/mb/Unicode/win1251_to_utf8.map src/utils/mb/Unicode/utf8_to_KOI8.map --> src/utils/mb/Unicode/utf8_to_koi8r.map src/utils/mb/Unicode/utf8_to_WIN.map --> src/utils/mb/Unicode/utf8_to_win1251.map * new file: src/utils/mb/encname.c * removed file: src/utils/mb/common.c -- Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
-
Bruce Momjian authored
really played it totally safe in my last suggestion, the system table might pick up the msg but not the netmsg.dll, so better try both. I also added a hex printout of the "errno" appended to all messages, that's nicer. If anyone hate my coding style, or that i'm using goto constructs, just tell me, and i'll rework it into a nested if () thing. Magnus Naeslund(f)
-
- 21 Aug, 2001 1 commit
-
-
Bruce Momjian authored
> 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
-
- 17 Aug, 2001 1 commit
-
-
Bruce Momjian authored
-
- 20 Jul, 2001 1 commit
-
-
Bruce Momjian authored
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
-
- 15 Jul, 2001 1 commit
-
-
Peter Eisentraut authored
accordingly.
-
- 06 Jul, 2001 1 commit
-
-
Peter Eisentraut authored
the startup exchange is complete. Also make sure that packets defined as single bytes aren't sent with a trailing '\0'.
-
- 28 May, 2001 1 commit
-
-
Tom Lane authored
data.
-
- 31 Mar, 2001 1 commit
-
-
Tom Lane authored
ready. It appears that most (all?) Unixen will consider a socket to be read or write ready if it has an error condition, but of course Microsoft does things differently.
-
- 22 Mar, 2001 1 commit
-
-
Bruce Momjian authored
-
- 17 Feb, 2001 1 commit
-
-
Tom Lane authored
if it returns EINTR.
-
- 11 Feb, 2001 1 commit
-
-
Bruce Momjian authored
-
- 10 Feb, 2001 1 commit
-
-
Tom Lane authored
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.
-
- 24 Jan, 2001 1 commit
-
-
Bruce Momjian authored
-
- 16 Nov, 2000 1 commit
-
-
Bruce Momjian authored
Context diff this time. Remove -m486 compile args for FreeBSD-i386, compile -O2 on i386. Compile with only -O on alpha for codegen safety. Make the port use the TEST_AND_SET for alpha and i386 on FreeBSD. Fix a lot of bogus string formats for outputting pointers (cast to int and %u/%x replaced with no cast and %p), and 'Size'(size_t) are now cast to 'unsigned long' and output with %lu/ Remove an unused variable. Alfred Perlstein
-
- 12 Apr, 2000 1 commit
-
-
Bruce Momjian authored
-
- 11 Apr, 2000 1 commit
-
-
Bruce Momjian authored
Alfred Perlstein
-
- 07 Feb, 2000 1 commit
-
-
Peter Eisentraut authored
Fixed libpq printing functions
-
- 29 Jan, 2000 1 commit
-
-
Peter Eisentraut authored
Initdb help correction Changed end/abort to commit/rollback and changed related notices Commented out way old printing functions in libpq Fixed a typo in alter table / alter column
-
- 26 Jan, 2000 1 commit
-
-
Bruce Momjian authored
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
-
- 20 Jan, 2000 1 commit
-
-
Tom Lane authored
-
- 18 Jan, 2000 2 commits
-
-
Bruce Momjian authored
Here is a patch to bring both libpq and psql to a state where it compiles on win32 (native) again. A lot of things have changed, and I have not been able to keep up with them all, so it has been broken for quite a while. After this patch, at least it compiles. It also talks "basic talk" to the server, but I have not yet tested all things. Sending queries, and using e.g. \d or \dt works fine. The rest will have to be tested further. It also bumps the version on libpq.dll to 7.0. Everything should be enclosed in #ifdef WIN32, unless I have missed something. Except for one or maybe two places where I have moved a #include that should not be used on win32 from the "global area" into a "#ifndef WIN32 area". //Magnus
-
Bruce Momjian authored
-
- 30 Nov, 1999 1 commit
-
-
Bruce Momjian authored
PQconnectStart PQconnectPoll PQresetStart PQresetPoll PQsetenvStart PQsetenvPoll PQsetenvAbort and brings into the published interface PQsetenv. The first four are asynchronous analogues of PQconnectdb and PQreset - they allow an application to connect to the DB without blocking on remote I/O. The PQsetenv functions perform an environment negotiation with the server. Internal to libpq, pqReadReady and pqWriteReady have been made available across the library (they were previously static functions inside fe-misc.c). A lot of internal rearrangement has been necessary to support these changes. The API documentation has been updated also. Caveats: o The Windows code does not default to using non-blocking sockets, since I have no documentation: Define WIN32_NON_BLOCKING_CONNECTIONS to do that. o The SSL code still blocks. Ewan Mellor.
-
- 11 Nov, 1999 1 commit
-
-
Bruce Momjian authored
* 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
-
- 27 Sep, 1999 1 commit
-
-
Bruce Momjian authored
When drawing up a very simple "text-drawing" of how the negotiation is done, I realised I had done this last part (fallback) in a very stupid way. Patch #4 fixes this, and does it in a much better way. Included is also the simple text-drawing of how the negotiation is done. //Magnus
-
- 13 Sep, 1999 1 commit
-
-
Tom Lane authored
message under a kernel that only returns one packet per recv() call. This didn't use to matter much, but it starts to get annoying with multi-megabyte EXPLAIN VERBOSE responses...
-
- 31 Aug, 1999 1 commit
-
-
Tom Lane authored
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...
-
- 19 Jul, 1999 1 commit
-
-
Bruce Momjian authored
-