Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-10Recognize network-failure errnos as indicating hard connection loss.Tom Lane
Up to now, only ECONNRESET (and EPIPE, in most but not quite all places) received special treatment in our error handling logic. This patch changes things so that related error codes such as ECONNABORTED are also recognized as indicating that the connection's dead and unlikely to come back. We continue to think, however, that only ECONNRESET and EPIPE should be reported as probable server crashes; the other cases indicate network connectivity problems but prove little about the server's state. Thus, there's no change in the error message texts that are output for such cases. The key practical effect is that errcode_for_socket_access() will report ERRCODE_CONNECTION_FAILURE rather than ERRCODE_INTERNAL_ERROR for a network failure. It's expected that this will fix buildfarm member lorikeet's failures since commit 32a9c0bdf, as that seems to be due to not treating ECONNABORTED equivalently to ECONNRESET. The set of errnos treated this way now includes ECONNABORTED, EHOSTDOWN, EHOSTUNREACH, ENETDOWN, ENETRESET, and ENETUNREACH. Several of these were second-class citizens in terms of their handling in places like get_errno_symbol(), so upgrade the infrastructure where necessary. As committed, this patch assumes that all these symbols are defined everywhere. POSIX specifies all of them except EHOSTDOWN, but that seems to exist on all platforms of interest; we'll see what the buildfarm says about that. Probably this should be back-patched, but let's see what the buildfarm thinks of it first. Fujii Masao and Tom Lane Discussion: https://postgr.es/m/2621622.1602184554@sss.pgh.pa.us
2017-04-11Remove support for bcc and msvc standalone libpq buildsMagnus Hagander
This removes the support for building just libpq using Borland C++ or Visual C++. This has not worked properly for years, and given the number of complaints it's clearly not worth the maintenance burden. Building libpq using the standard MSVC build system is of course still supported, along with mingw.
2011-12-10Enable compiling with the mingw-w64 32 bit compiler.Andrew Dunstan
Original patch by Lars Kanis, reviewed by Nishiyama Tomoaki and tweaked some by me. This compiler, or at least the latest version of it, is currently broken, and only passes the regression tests if built with -O0.
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2009-06-118.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian
provided by Andrew.
2008-05-17Add $PostgreSQL$ markers to a lot of files that were missing them.Andrew Dunstan
This particular batch was just for *.c and *.h file. The changes were made with the following 2 commands: find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *' find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */'
2005-12-06Make Win32 build use our port/snprintf.c routines, instead of dependingTom Lane
on libintl which may or may not provide what we need. Make a few marginal cleanups to ensure this works. Andrew Dunstan and Tom Lane.
2004-07-31>OK, if you look at the last few commits to interfaces/libpq/win32.mak,Bruce Momjian
>you will see changes for pg_config_paths.h and for thread safety. Can >you look at those changes, merge them into bcc.mak. There might be >other changes in there you want to add to bcc.mak too. > > > OK, having no M$ diff, I attach files src\interfaces\libpq\bcc32.mak and src\interfaces\libpq\win32.h Steve Holdoway
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-04-19* Most changes are to fix warnings issued when compiling win32Bruce Momjian
* removed a few redundant defines * get_user_name safe under win32 * rationalized pipe read EOF for win32 (UPDATED PATCH USED) * changed all backend instances of sleep() to pg_usleep - except for the SLEEP_ON_ASSERT in assert.c, as it would exceed a 32-bit long [Note to patcher: If a SLEEP_ON_ASSERT of 2000 seconds is acceptable, please replace with pg_usleep(2000000000L)] I added a comment to that part of the code: /* * It would be nice to use pg_usleep() here, but only does 2000 sec * or 33 minutes, which seems too short. */ sleep(1000000); Claudio Natoli
2004-03-24Allow unlink/rename of files open by another process on Win32, using aBruce Momjian
special Win32 open flag FILE_SHARE_DELETE. Claudio Natoli
2003-06-14Make libpq thread-safe with configure --with-threads option.Bruce Momjian
Lee Kindness
2003-05-09More cleanups now that we have crypt().Bruce Momjian
2002-12-30Attached is a patch to provide makefiles, etc. to allow the compilationBruce Momjian
of the libpq interface static and dynamic libraries with the freely downloadable Borland C++ compiler version 5.5 and/or C++ Builder. Lester Godwin
2002-10-03The attached patch fixes a number of issues related to compiling theBruce Momjian
client utilities (libpq.dll and psql.exe) for win32 (missing defines, adjustments to includes, pedantic casting, non-existent functions) per: http://developer.postgresql.org/docs/postgres/install-win32.html. It compiles cleanly under Windows 2000 using Visual Studio .net. Also compiles clean and passes all regression tests (regular and contrib) under Linux. In addition to a review by the usual suspects, it would be very desirable for someone well versed in the peculiarities of win32 to take a look. Joe Conway
2002-07-20Hello, i noticed that win32 native stopped working/compiling after the SSL mergeBruce Momjian
. So i took the opportunity to fix some stuff: 1. Made the thing compile (typos & needed definitions) with the new pqsecure_* s tuff, and added fe-secure.c to the win32.mak makefile. 2. Fixed some MULTIBYTE compile errors (when building without MB support). 3. Made it do that you can build with debug info: "nmake -f win32.mak DEBUG=1". 4. Misc small compiler speedup changes. The resulting .dll has been tested in production, and everything seems ok. I CC:ed -hackers because i'm not sure about two things: 1. In libpq-int.h I typedef ssize_t as an int because Visual C (v6.0) doesn't de fine ssize_t. Is that ok, or is there any standard about what type should be use d for ssize_t? 2. To keep the .dll api consistent regarding MULTIBYTE I just return -1 in fe-connect.c:PQsetClientEncoding() instead of taking away the whole function. I wonder if i should do any compares with the conn->client_encoding and return 0 if not hing would have changed (if so how do i check that?). Regards Magnus Naeslund
2001-11-28Load netmsg.dll locally in winsock_strerror, to avoid actual andTom Lane
potential problems discussed in pgsql-interfaces.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-08-21> Ok, where's a "system dependent hack" :)Bruce Momjian
> 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
2001-08-03Fix residual breakage from Windows socket-errno patch: the routinesTom Lane
that should use regular errno, not WSAGetLastError(), now do so again.
2001-07-21I downloaded new source for lib (only few hours old !!!), and madeBruce Momjian
changes on this new source to make non-blocking connection work. I tested it, and PQSendQuery and PQGetResult are working fine. In win32.h I added one line: #define snprintf _snprintf Darko Prenosil
2001-07-20i've spotted a following problem using DBD::Pg under win32. winsockBruce Momjian
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
2001-02-07Actually, it looks like DEF_PGPORT belongs over in config.h.win32 forTom Lane
the Windows build...
2001-02-07Remove broken (and unnecessary) definition of DEF_PGPORT.Tom Lane
2000-06-11Substituted new configure test for types of accept()Peter Eisentraut
Interfaced a lot of the custom tests to the config.cache, in the process made them separate macros and grouped them out into files. Made naming adjustments. Removed a couple of useless/unused configure tests. Disabled C++ by default. C++ is no more special than Perl, Python, and Tcl. And it breaks equally often. :(
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-02-24 The following is required in order to make beta1 compile on the Win32Bruce Momjian
platform (psql and libpq): The file "config.h.win32" in the include\ directory (from my patch from 2000-01-18) is missing from the tree. It needs to be put back :-) The following patch has to be applied in the interfaces\libpq directory. //Magnus
2000-02-07Fixed psql double quoting of SQL idsPeter Eisentraut
Fixed libpq printing functions
1999-10-23Remove gratuitous redefinitions of BLCKSZ.Tom Lane
1999-07-19Re-add getopt.h check, remove NT-specific tests for it.Bruce Momjian
1999-06-07> Here is a small patch that should only affect win32 buildingBruce Momjian
> (native win32, not cygnus). > It does the following: > Patches two win32.mak files to DEFINE HAVE_VSNPRINTF and > HAVE_STRDUP. This is required to build at all. > Bumps the version number on libpq.dll from 6.4 to 6.5. > Required for install programs to work. > Adds defintions for BLCKSZ and MAXIMUM_ALIGN to "win32.h" in > the client-side libpiq directory. > > All these files are only used when building on native win32, > so it should be safe I think. > > Again, really sorry to throw this in so late, but I would > hate to do the same thing as with 6.4 (which required 6.4.1 > to at all compile on Win32). > > Thanks, > > //Magnus
1998-12-14Compilation of libpq for Win32 breaks on 6.4, because of a change that IBruce Momjian
missed before the release. It's simply a symbol that is undefined. This patch defines this symbol in "win32.h", so it should have no effect on any other platforms. It should go into 6.4.1 if possible, since compilation is completely broken without it. I am also attaching a patch for the "win32.mak" file - it leaves a file behind when doing "make clean" after the library is built on Visual C++ 6.0. This is not at all as urgent, but I don't see it breaking here, so I think it might as well go in there too? //Magnus
1998-09-01OK, folks, here is the pgindent output.Bruce Momjian
1998-07-03Hello!Bruce Momjian
Through some minor changes, I have been able to compile the libpq client libraries on the Win32 platform. Since the libpq communications part has been rewritten, this has become much easier. Enclosed is a patch that will allow at least Microsoft Visual C++ to compile libpq into both a static and a dynamic library. I will take a look at porting the psql frontend as well, but I figured it was a good idea to send in these patches first - so no major changes are done to the files before it gets applied (if it does). Regards, Magnus Hagander