1. 05 Mar, 2002 2 commits
    • Bruce Momjian's avatar
      Back out old version and update with newer patch of: · 6024ac1b
      Bruce Momjian authored
      	Fix for non-blocking connections in libpq
      
      Bernhard Herzog
      6024ac1b
    • Bruce Momjian's avatar
      Here's a patch against 7.1.3 that fixes a problem with sending larger · 33766e68
      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
      33766e68
  2. 03 Dec, 2001 1 commit
  3. 28 Nov, 2001 1 commit
  4. 27 Nov, 2001 1 commit
  5. 08 Nov, 2001 2 commits
  6. 05 Nov, 2001 1 commit
  7. 28 Oct, 2001 1 commit
  8. 25 Oct, 2001 1 commit
  9. 30 Sep, 2001 1 commit
  10. 06 Sep, 2001 2 commits
    • Tatsuo Ishii's avatar
      Commit Karel's patch. · 22776711
      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
      22776711
    • Bruce Momjian's avatar
      Hello, i just reviewed the win32 errno patch and i saw that maybe i didn't · ee0ef05b
      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)
      ee0ef05b
  11. 21 Aug, 2001 1 commit
    • Bruce Momjian's avatar
      > Ok, where's a "system dependent hack" :) · 5db5c2db
      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
      5db5c2db
  12. 17 Aug, 2001 1 commit
  13. 20 Jul, 2001 1 commit
    • Bruce Momjian's avatar
      i've spotted a following problem using DBD::Pg under win32. winsock · 8c79f3c4
      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
      8c79f3c4
  14. 15 Jul, 2001 1 commit
  15. 06 Jul, 2001 1 commit
  16. 28 May, 2001 1 commit
  17. 31 Mar, 2001 1 commit
  18. 22 Mar, 2001 1 commit
  19. 17 Feb, 2001 1 commit
  20. 11 Feb, 2001 1 commit
  21. 10 Feb, 2001 1 commit
    • Tom Lane's avatar
      Restructure the key include files per recent pghackers discussion: there · d08741ea
      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.
      d08741ea
  22. 24 Jan, 2001 1 commit
  23. 16 Nov, 2000 1 commit
    • Bruce Momjian's avatar
      Make pgsql compile on FreeBSD-alpha. · 312063c9
      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
      312063c9
  24. 12 Apr, 2000 1 commit
  25. 11 Apr, 2000 1 commit
  26. 07 Feb, 2000 1 commit
  27. 29 Jan, 2000 1 commit
    • Peter Eisentraut's avatar
      A few minor psql enhancements · 2b84cbb6
      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
      2b84cbb6
  28. 26 Jan, 2000 1 commit
    • Bruce Momjian's avatar
      Add: · 5c25d602
      Bruce Momjian authored
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  29. 20 Jan, 2000 1 commit
  30. 18 Jan, 2000 2 commits
    • Bruce Momjian's avatar
      Hi! · 0cb6bc70
      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
      0cb6bc70
    • Bruce Momjian's avatar
      10d7287a
  31. 30 Nov, 1999 1 commit
    • Bruce Momjian's avatar
      This patch (against the current CVS sources) adds to libpq the functions · 3ab5b1f1
      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.
      3ab5b1f1
  32. 11 Nov, 1999 1 commit
    • Bruce Momjian's avatar
      In the spirit of TODO item · 2a24ec6f
      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
      2a24ec6f
  33. 27 Sep, 1999 1 commit
    • Bruce Momjian's avatar
      Lots of patches coming in from me today :-) · e0e7daef
      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
      e0e7daef
  34. 13 Sep, 1999 1 commit
  35. 31 Aug, 1999 1 commit
    • Tom Lane's avatar
      Update frontend libpq to remove limits on query lengths, · ab5cafa5
      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...
      ab5cafa5
  36. 19 Jul, 1999 1 commit