aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-misc.c
Commit message (Collapse)AuthorAge
...
* Remove code to lookup WinSock error strings in netmsg.dll; according toTom Lane2001-12-03
| | | | | | 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.
* Load netmsg.dll locally in winsock_strerror, to avoid actual andTom Lane2001-11-28
| | | | potential problems discussed in pgsql-interfaces.
* strcat should obviously be strcpy here.Tom Lane2001-11-27
|
* Fix indenting for 'extern "C"' cases.Bruce Momjian2001-11-08
|
* Add casts to suppress compiler warnings observed on Darwin platformTom Lane2001-11-08
| | | | (surprised no one has reported these yet...)
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-28
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* winsock_strerror crashed on me. This fixes a line of code that looksTom Lane2001-09-30
| | | | | | cleverer than it actually is ;-) Braces are good for you :-) Gerhard HÃŒring
* Commit Karel's patch.Tatsuo Ishii2001-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------- 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
* Hello, i just reviewed the win32 errno patch and i saw that maybe i didn'tBruce Momjian2001-09-06
| | | | | | | | | | | | 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)
* > 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
|
* 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'.
* Suppress useless memmove() when buffer already contains left-justifiedTom Lane2001-05-28
| | | | data.
* pqWait() should check for exception status as well as read or writeTom Lane2001-03-31
| | | | | | 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.
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Seems a bad idea to assume that select(2) doesn't touch the input masksTom Lane2001-02-17
| | | | if it returns EINTR.
* Cleanup of source.Bruce Momjian2001-02-11
|
* 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.
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Make pgsql compile on FreeBSD-alpha.Bruce Momjian2000-11-16
| | | | | | | | | | | | | | | | | | 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
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Thomas pointed out this bug in my non-blocking stuff.Bruce Momjian2000-04-11
| | | | Alfred Perlstein
* Fixed psql double quoting of SQL idsPeter Eisentraut2000-02-07
| | | | Fixed libpq printing functions
* A few minor psql enhancementsPeter Eisentraut2000-01-29
| | | | | | | 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
* 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.
* Tweak includes to avoid compiler warning on HPUX.Tom Lane2000-01-20
|
* Hi!Bruce Momjian2000-01-18
| | | | | | | | | | | | | | | | | | 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
* Libpq non-blocking mode, from Alfred PerlsteinBruce Momjian2000-01-18
|
* This patch (against the current CVS sources) adds to libpq the functionsBruce Momjian1999-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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
* Lots of patches coming in from me today :-)Bruce Momjian1999-09-27
| | | | | | | | | | 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
* Patch to cure O(N^2) behavior in libpq when reading a longTom Lane1999-09-13
| | | | | | 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...
* 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
|
* Final optimizer cleanups.Bruce Momjian1999-02-22
|
* Fix memory leak from Tom Lane.Bruce Momjian1998-09-20
|
* Attached is a patch to remove the definitions of libpq's internalBruce Momjian1998-09-03
| | | | | | | | | | | | | | | | | structs from libpq-fe.h, as we previously discussed. There turned out to be sloppy coding practices in more places than I had realized :-(, but all in all I think it was a well-worth-while exercise. I ended up adding several routines to libpq's API in order to respond to application requirements that were exposed by this work. I owe the docs crew updates for libpq.sgml to describe these changes. I'm way too tired to work on the docs tonight, however. This is the last major change I intend to submit for 6.4. I do want to see if I can make libpgtcl work with Tcl 8.0 before we go final, but hopefully that will be a minor bug fix.
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-01
|
* libpq's pqGetnchar() should not return a null-terminated valueBruce Momjian1998-08-29
| | | | anymore. Fix for large objects.
* Date: Sun, 16 Aug 1998 14:56:48 -0400Marc G. Fournier1998-08-17
| | | | | | | | From: Tom Lane <tgl@sss.pgh.pa.us> Attached is a patch for this weekend's work on libpq. I've dealt with several issues: <for details: see message, in pgsql-patches archive for above data>
* The attached patch implements some changes that were discussed aBruce Momjian1998-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | couple weeks ago on the hackers and interfaces lists: 1. When the backend sends a NOTICE message and closes the connection (typically, because it was told to by the postmaster after another backend coredumped), libpq will now print the notice and close the connection cleanly. Formerly, the frontend app would usually terminate ungracefully due to a SIGPIPE. (I am not sure if 6.3.2 behaved that way, but the current cvs sources do...) 2. libpq's various printouts to stderr are now fed through a single "notice processor" routine, which can be overridden by the application to direct notices someplace else. This should ease porting libpq to Windows. I also noticed and fixed a problem in PQprint: when sending output to a pager subprocess, it would disable SIGPIPE in case the pager terminates early (this is good) --- but afterwards it reset SIGPIPE to SIG_DFL, rather than restoring the application's prior setting (bad). regards, tom lane
* Hello!Bruce Momjian1998-07-03
| | | | | | | | | | | | | | 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