1. 20 Dec, 2019 1 commit
    • Andrew Dunstan's avatar
      Superuser can permit passwordless connections on postgres_fdw · 6136e94d
      Andrew Dunstan authored
      Currently postgres_fdw doesn't permit a non-superuser to connect to a
      foreign server without specifying a password, or to use an
      authentication mechanism that doesn't use the password. This is to avoid
      using the settings and identity of the user running Postgres.
      
      However, this doesn't make sense for all authentication methods. We
      therefore allow a superuser to set "password_required 'false'" for user
      mappings for the postgres_fdw. The superuser must ensure that the
      foreign server won't try to rely solely on the server identity (e.g.
      trust, peer, ident) or use an authentication mechanism that relies on the
      password settings (e.g. md5, scram-sha-256).
      
      This feature is a prelude to better support for sslcert and sslkey
      settings in user mappings.
      
      Author: Craig Ringer.
      Discussion: https://postgr.es/m/075135da-545c-f958-fed0-5dcb462d6dae@2ndQuadrant.com
      6136e94d
  2. 19 Dec, 2019 9 commits
  3. 18 Dec, 2019 11 commits
  4. 17 Dec, 2019 14 commits
  5. 16 Dec, 2019 5 commits
    • Tom Lane's avatar
      On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. · 6d7547c2
      Tom Lane authored
      Attempting to open a file fails with ERROR_ACCESS_DENIED if the file
      is flagged for deletion but not yet actually gone (another in a long
      list of reasons why Windows is broken, if you ask me).  This seems
      likely to explain a lot of irreproducible failures we see in the
      buildfarm.  This state generally persists for only a millisecond or so,
      so just wait a bit and retry.  If it's a real permissions problem,
      we'll eventually give up and report it as such.  If it's the pending
      deletion case, we'll see file-not-found and report that after the
      deletion completes, and the caller will treat that in an appropriate
      way.
      
      In passing, rejigger the existing retry logic for some other error
      cases so that we don't uselessly wait an extra time when we're
      not going to retry anymore.
      
      Alexander Lakhin (with cosmetic tweaks by me).  Back-patch to all
      supported branches, since this seems like a pretty safe change and
      the problem is definitely real.
      
      Discussion: https://postgr.es/m/16161-7a985d2f1bbe8f71@postgresql.org
      6d7547c2
    • Alvaro Herrera's avatar
      Demote variable from global to local · 91fca4bb
      Alvaro Herrera authored
      recoveryDelayUntilTime was introduced by commit 36da3cfb as a global
      because its method of operation was devilishly intrincate.  Commit
      c945af80 removed all that complexity and could have turned it into a
      local variable, but didn't.  Do so now.
      
      Discussion: https://postgr.es/m/20191213200751.GA10731@alvherre.pgsql
      Reviewed-by: Michaël Paquier, Daniel Gustafsson
      91fca4bb
    • Heikki Linnakangas's avatar
      Fix yet another crash in page split during GiST index creation. · 741b8843
      Heikki Linnakangas authored
      Commit a7ee7c85 fixed a bug in GiST page split during index creation,
      where we failed to re-find the position of a downlink after the page
      containing it was split. However, that fix was incomplete; the other call
      to gistinserttuples() in the same function needs to also clear
      'downlinkoffnum'.
      
      Fixes bug #16134 reported by Alexander Lakhin, for real this time. The
      previous fix was enough to fix the crash with the reproducer script for
      bug #16162, but the original script for #16134 was still crashing.
      
      Backpatch to v12, like the previous incomplete fix.
      
      Discussion: https://www.postgresql.org/message-id/d869f537-abe4-d2ea-0510-38cd053f5152%40gmail.com
      741b8843
    • Peter Eisentraut's avatar
      Fix build of Perl-using modules of Windows · 50242318
      Peter Eisentraut authored
      Commit f14413b6 broke the build of
      Perl-using modules on Windows.
      
      Perl might have its own definitions of uid_t and gid_t, so we hide
      ours, but then we can't use ours in our header files such as port.h
      which don't see the Perl definition.
      
      Hide our definition of getpeereid() on Windows in Perl-using modules,
      using PLPERL_HAVE_UID_GID define.  That means we can't portably use
      getpeeruid() is such modules right now, but there is no need anyway.
      50242318
    • Peter Eisentraut's avatar
      Sort out getpeereid() and peer auth handling on Windows · f14413b6
      Peter Eisentraut authored
      The getpeereid() uses have so far been protected by HAVE_UNIX_SOCKETS,
      so they didn't ever care about Windows support.  But in anticipation
      of Unix-domain socket support on Windows, that needs to be handled
      differently.
      
      Windows doesn't support getpeereid() at this time, so we use the
      existing not-supported code path.  We let configure do its usual thing
      of picking up the replacement from libpgport, instead of the custom
      overrides that it was doing before.
      
      But then Windows doesn't have struct passwd, so this patch sprinkles
      some additional #ifdef WIN32 around to make it work.  This is similar
      to existing code that deals with this issue.
      Reviewed-by: default avatarAndrew Dunstan <andrew.dunstan@2ndquadrant.com>
      Discussion: https://www.postgresql.org/message-id/5974caea-1267-7708-40f2-6009a9d653b0@2ndquadrant.com
      f14413b6