1. 19 8月, 2013 1 次提交
  2. 18 8月, 2013 1 次提交
  3. 02 8月, 2013 1 次提交
    • S
      Improve handling of pthread_mutex_lock error case · 8359ed80
      Stephen Frost 提交于
      We should really be reporting a useful error along with returning
      a valid return code if pthread_mutex_lock() throws an error for
      some reason.  Add that and back-patch to 9.0 as the prior patch.
      
      Pointed out by Alvaro Herrera
      8359ed80
  4. 01 8月, 2013 1 次提交
    • S
      Add locking around SSL_context usage in libpq · aad2a630
      Stephen Frost 提交于
      I've been working with Nick Phillips on an issue he ran into when
      trying to use threads with SSL client certificates.  As it turns out,
      the call in initialize_SSL() to SSL_CTX_use_certificate_chain_file()
      will modify our SSL_context without any protection from other threads
      also calling that function or being at some other point and trying to
      read from SSL_context.
      
      To protect against this, I've written up the attached (based on an
      initial patch from Nick and much subsequent discussion) which puts
      locks around SSL_CTX_use_certificate_chain_file() and all of the other
      users of SSL_context which weren't already protected.
      
      Nick Phillips, much reworked by Stephen Frost
      
      Back-patch to 9.0 where we started loading the cert directly instead of
      using a callback.
      aad2a630
  5. 30 7月, 2013 1 次提交
  6. 24 7月, 2013 1 次提交
  7. 23 7月, 2013 1 次提交
  8. 19 7月, 2013 1 次提交
    • M
      Initialize day of year value. · a2c1c330
      Michael Meskes 提交于
      There are cases where the day of year value in struct tm is used, but it never
      got calculated. Problem found by Coverity scan.
      a2c1c330
  9. 16 7月, 2013 1 次提交
  10. 07 7月, 2013 1 次提交
  11. 05 7月, 2013 1 次提交
  12. 30 6月, 2013 1 次提交
  13. 28 6月, 2013 1 次提交
    • T
      Expect EWOULDBLOCK from a non-blocking connect() call only on Windows. · a099482c
      Tom Lane 提交于
      On Unix-ish platforms, EWOULDBLOCK may be the same as EAGAIN, which is
      *not* a success return, at least not on Linux.  We need to treat it as a
      failure to avoid giving a misleading error message.  Per the Single Unix
      Spec, only EINPROGRESS and EINTR returns indicate that the connection
      attempt is in progress.
      
      On Windows, on the other hand, EWOULDBLOCK (WSAEWOULDBLOCK) is the expected
      case.  We must accept EINPROGRESS as well because Cygwin will return that,
      and it doesn't seem worth distinguishing Cygwin from native Windows here.
      It's not very clear whether EINTR can occur on Windows, but let's leave
      that part of the logic alone in the absence of concrete trouble reports.
      
      Also, remove the test for errno == 0, effectively reverting commit
      da9501bd, which AFAICS was just a thinko;
      or at best it might have been a workaround for a platform-specific bug,
      which we can hope is gone now thirteen years later.  In any case, since
      libpq makes no effort to reset errno to zero before calling connect(),
      it seems unlikely that that test has ever reliably done anything useful.
      
      Andres Freund and Tom Lane
      a099482c
  14. 15 6月, 2013 2 次提交
  15. 03 6月, 2013 1 次提交
  16. 01 6月, 2013 1 次提交
    • S
      Post-pgindent cleanup · 551938ae
      Stephen Frost 提交于
      Make slightly better decisions about indentation than what pgindent
      is capable of.  Mostly breaking out long function calls into one
      line per argument, with a few other minor adjustments.
      
      No functional changes- all whitespace.
      pgindent ran cleanly (didn't change anything) after.
      Passes all regressions.
      551938ae
  17. 30 5月, 2013 1 次提交
  18. 06 5月, 2013 1 次提交
  19. 29 4月, 2013 1 次提交
    • R
      Attempt to fix error recovery in COPY BOTH mode. · 91fa8532
      Robert Haas 提交于
      Previously, libpq and the backend had opposite ideas about whether
      it was necessary for the client to send a CopyDone message after
      receiving an ErrorResponse, making it impossible to cleanly exit
      COPY BOTH mode.  Fix libpq so that works correctly, adopting the
      backend's notion that an ErrorResponse kills the copy in both
      directions.
      
      Adjust receivelog.c to avoid a degradation in the quality of the
      resulting error messages.  libpqwalreceiver.c is already doing
      the right thing, so no adjustment needed there.
      
      Add an explicit statement to the documentation explaining how
      this part of the protocol is supposed to work, in the hopes of
      avoiding future confusion in this area.
      
      Since the consequences of all this confusion are very limited,
      especially in the back-branches where no client ever attempts
      to exit COPY BOTH mode without closing the connection entirely,
      no back-patch.
      91fa8532
  20. 26 4月, 2013 1 次提交
  21. 20 4月, 2013 1 次提交
    • P
      Clean up references to SQL92 · cc26ea9f
      Peter Eisentraut 提交于
      In most cases, these were just references to the SQL standard in
      general.  In a few cases, a contrast was made between SQL92 and later
      standards -- those have been kept unchanged.
      cc26ea9f
  22. 19 4月, 2013 1 次提交
  23. 01 4月, 2013 3 次提交
    • P
      Revert "ecpg: Don't link compatlib with libpq" · 85079078
      Peter Eisentraut 提交于
      This reverts commit 3780fc67.
      
      HP-UX didn't like it.  There would probably be a way to fix that, but
      since the net effect of all of this is zero because ecpg ends up using
      libpq anyway, it's not worth bothering further.
      85079078
    • P
      Add pkg-config files for libpq and ecpg libraries · 64f89090
      Peter Eisentraut 提交于
      This will hopefully be easier to use than pg_config for users who are
      already used to the pkg-config interface.  It also works better for
      multi-arch installations.
      
      reviewed by Tom Lane
      64f89090
    • P
      ecpg: Don't link compatlib with libpq · 3780fc67
      Peter Eisentraut 提交于
      It doesn't actually use libpq.  But we need to keep libpq in the
      CPPFLAGS for building, because compatlib uses ecpglib.h which uses
      libpq-fe.h, but we don't need to refer to libpq for linking.
      
      reviewed by Tom Lane
      3780fc67
  24. 30 3月, 2013 1 次提交
    • P
      ecpg: Parallel make fix · 602070f9
      Peter Eisentraut 提交于
      In some parallel make situations, the install-headers target could be
      called before the installation directories are created by installdirs,
      causing the installation to fail.  Fix that by making install-headers
      depend on installdirs.
      602070f9
  25. 18 3月, 2013 2 次提交
    • T
      Re-include pqsignal() in libpq. · b1fae823
      Tom Lane 提交于
      We need this in non-ENABLE_THREAD_SAFETY builds, and also to satisfy
      the exports.txt entry; while it might be a good idea to remove the
      latter, I'm hesitant to do so except in the context of an intentional
      ABI break.  At least we don't have a separately maintained source file
      for it anymore.
      b1fae823
    • T
      Move pqsignal() to libpgport. · da5aeccf
      Tom Lane 提交于
      We had two copies of this function in the backend and libpq, which was
      already pretty bogus, but it turns out that we need it in some other
      programs that don't use libpq (such as pg_test_fsync).  So put it where
      it probably should have been all along.  The signal-mask-initialization
      support in src/backend/libpq/pqsignal.c stays where it is, though, since
      we only need that in the backend.
      da5aeccf
  26. 05 3月, 2013 1 次提交
  27. 28 2月, 2013 1 次提交
    • H
      Add support for piping COPY to/from an external program. · 3d009e45
      Heikki Linnakangas 提交于
      This includes backend "COPY TO/FROM PROGRAM '...'" syntax, and corresponding
      psql \copy syntax. Like with reading/writing files, the backend version is
      superuser-only, and in the psql version, the program is run in the client.
      
      In the passing, the psql \copy STDIN/STDOUT syntax is subtly changed: if you
      the stdin/stdout is quoted, it's now interpreted as a filename. For example,
      "\copy foo from 'stdin'" now reads from a file called 'stdin', not from
      standard input. Before this, there was no way to specify a filename called
      stdin, stdout, pstdin or pstdout.
      
      This creates a new function in pgport, wait_result_to_str(), which can
      be used to convert the exit status of a process, as returned by wait(3),
      to a human-readable string.
      
      Etsuro Fujita, reviewed by Amit Kapila.
      3d009e45
  28. 27 2月, 2013 1 次提交
  29. 30 1月, 2013 1 次提交
    • T
      Provide database object names as separate fields in error messages. · 991f3e5a
      Tom Lane 提交于
      This patch addresses the problem that applications currently have to
      extract object names from possibly-localized textual error messages,
      if they want to know for example which index caused a UNIQUE_VIOLATION
      failure.  It adds new error message fields to the wire protocol, which
      can carry the name of a table, table column, data type, or constraint
      associated with the error.  (Since the protocol spec has always instructed
      clients to ignore unrecognized field types, this should not create any
      compatibility problem.)
      
      Support for providing these new fields has been added to just a limited set
      of error reports (mainly, those in the "integrity constraint violation"
      SQLSTATE class), but we will doubtless add them to more calls in future.
      
      Pavel Stehule, reviewed and extensively revised by Peter Geoghegan, with
      additional hacking by Tom Lane.
      991f3e5a
  30. 27 1月, 2013 1 次提交
  31. 24 1月, 2013 1 次提交
    • R
      pg_isready · ac2e9673
      Robert Haas 提交于
      New command-line utility to test whether a server is ready to
      accept connections.
      
      Phil Sorber, reviewed by Michael Paquier and Peter Eisentraut
      ac2e9673
  32. 21 1月, 2013 1 次提交
    • T
      Fix one-byte buffer overrun in PQprintTuples(). · 8f0d8f48
      Tom Lane 提交于
      This bug goes back to the original Postgres95 sources.  Its significance
      to modern PG versions is marginal, since we have not used PQprintTuples()
      internally in a very long time, and it doesn't seem to have ever been
      documented either.  Still, it *is* exposed to client apps, so somebody
      out there might possibly be using it.
      
      Xi Wang
      8f0d8f48
  33. 12 1月, 2013 1 次提交
    • A
      Extend and improve use of EXTRA_REGRESS_OPTS. · 4ae5ee6c
      Andrew Dunstan 提交于
      This is now used by ecpg tests, and not clobbered by pg_upgrade
      tests. This change won't affect anything that doesn't set this
      environment variable, but will enable the buildfarm to control
      exactly what port regression test installs will be running on,
      and thus to detect possible rogue postmasters more easily.
      
      Backpatch to release 9.2 where EXTRA_REGRESS_OPTS was first used.
      4ae5ee6c
  34. 02 1月, 2013 1 次提交
  35. 14 12月, 2012 1 次提交
    • H
      Allow a streaming replication standby to follow a timeline switch. · abfd192b
      Heikki Linnakangas 提交于
      Before this patch, streaming replication would refuse to start replicating
      if the timeline in the primary doesn't exactly match the standby. The
      situation where it doesn't match is when you have a master, and two
      standbys, and you promote one of the standbys to become new master.
      Promoting bumps up the timeline ID, and after that bump, the other standby
      would refuse to continue.
      
      There's significantly more timeline related logic in streaming replication
      now. First of all, when a standby connects to primary, it will ask the
      primary for any timeline history files that are missing from the standby.
      The missing files are sent using a new replication command TIMELINE_HISTORY,
      and stored in standby's pg_xlog directory. Using the timeline history files,
      the standby can follow the latest timeline present in the primary
      (recovery_target_timeline='latest'), just as it can follow new timelines
      appearing in an archive directory.
      
      START_REPLICATION now takes a TIMELINE parameter, to specify exactly which
      timeline to stream WAL from. This allows the standby to request the primary
      to send over WAL that precedes the promotion. The replication protocol is
      changed slightly (in a backwards-compatible way although there's little hope
      of streaming replication working across major versions anyway), to allow
      replication to stop when the end of timeline reached, putting the walsender
      back into accepting a replication command.
      
      Many thanks to Amit Kapila for testing and reviewing various versions of
      this patch.
      abfd192b
  36. 04 12月, 2012 1 次提交