Skip to content
Snippets Groups Projects
  1. Apr 18, 2017
  2. Apr 17, 2017
  3. Apr 16, 2017
  4. Apr 15, 2017
    • Tom Lane's avatar
      Provide a way to control SysV shmem attach address in EXEC_BACKEND builds. · a74740fb
      Tom Lane authored
      In standard non-Windows builds, there's no particular reason to care what
      address the kernel chooses to map the shared memory segment at.  However,
      when building with EXEC_BACKEND, there's a risk that the chosen address
      won't be available in all child processes.  Linux with ASLR enabled (which
      it is by default) seems particularly at risk because it puts shmem segments
      into the same area where it maps shared libraries.  We can work around
      that by specifying a mapping address that's outside the range where
      shared libraries could get mapped.  On x86_64 Linux, 0x7e0000000000
      seems to work well.
      
      This is only meant for testing/debugging purposes, so it doesn't seem
      necessary to go as far as providing a GUC (or any user-visible
      documentation, though we might change that later).  Instead, it's just
      controlled by setting an environment variable PG_SHMEM_ADDR to the
      desired attach address.
      
      Back-patch to all supported branches, since the point here is to
      remove intermittent buildfarm failures on EXEC_BACKEND animals.
      Owners of affected animals will need to add a suitable setting of
      PG_SHMEM_ADDR to their build_env configuration.
      
      Discussion: https://postgr.es/m/7036.1492231361@sss.pgh.pa.us
      a74740fb
    • Tom Lane's avatar
      Fix erroneous cross-reference in comment. · bfba563b
      Tom Lane authored
      Seems to have been introduced in commit c219d9b0.  I think there indeed
      was a "tupbasics.h" in some early drafts of that refactoring, but it
      didn't survive into the committed version.
      
      Amit Kapila
      bfba563b
    • Tom Lane's avatar
      More cleanup of manipulations of hash indexes' hasho_flag field. · 083dc95a
      Tom Lane authored
      Not much point in defining test macros for the flag bits if we
      don't use 'em.
      
      Amit Kapila
      083dc95a
    • Andrew Dunstan's avatar
      Downcase "Wincrypt.h" · 0eba6be1
      Andrew Dunstan authored
      This is consistent with how we refer to other Windows include files, and
      prevents a failure when cross-compiling on a system with case sensitive
      file names.
      0eba6be1
    • Tom Lane's avatar
      Avoid passing function pointers across process boundaries. · 32470825
      Tom Lane authored
      We'd already recognized that we can't pass function pointers across process
      boundaries for functions in loadable modules, since a shared library could
      get loaded at different addresses in different processes.  But actually the
      practice doesn't work for functions in the core backend either, if we're
      using EXEC_BACKEND.  This is the cause of recent failures on buildfarm
      member culicidae.  Switch to passing a string function name in all cases.
      
      Something like this needs to be back-patched into 9.6, but let's see
      if the buildfarm likes it first.
      
      Petr Jelinek, with a bunch of basically-cosmetic adjustments by me
      
      Discussion: https://postgr.es/m/548f9c1d-eafa-e3fa-9da8-f0cc2f654e60@2ndquadrant.com
      32470825
  5. Apr 14, 2017
  6. Apr 13, 2017
    • Tom Lane's avatar
      Fix regexport.c to behave sanely with lookaround constraints. · 6cfaffc0
      Tom Lane authored
      regexport.c thought it could just ignore LACON arcs, but the correct
      behavior is to treat them as satisfiable while consuming zero input
      (rather reminiscently of commit 9f1e642d).  Otherwise, the emitted
      simplified-NFA representation may contain no paths leading from initial
      to final state, which unsurprisingly confuses pg_trgm, as seen in
      bug #14623 from Jeff Janes.
      
      Since regexport's output representation has no concept of an arc that
      consumes zero input, recurse internally to find the next normal arc(s)
      after any LACON transitions.  We'd be forced into changing that
      representation if a LACON could be the last arc reaching the final
      state, but fortunately the regex library never builds NFAs with such
      a configuration, so there always is a next normal arc.
      
      Back-patch to 9.3 where this logic was introduced.
      
      Discussion: https://postgr.es/m/20170413180503.25948.94871@wrigleys.postgresql.org
      6cfaffc0
    • Heikki Linnakangas's avatar
      Improve the SASL authentication protocol. · 4f3b87ab
      Heikki Linnakangas authored
      This contains some protocol changes to SASL authentiation (which is new
      in v10):
      
      * For future-proofing, in the AuthenticationSASL message that begins SASL
        authentication, provide a list of SASL mechanisms that the server
        supports, for the client to choose from. Currently, it's always just
        SCRAM-SHA-256.
      
      * Add a separate authentication message type for the final server->client
        SASL message, which the client doesn't need to respond to. This makes
        it unambiguous whether the client is supposed to send a response or not.
        The SASL mechanism should know that anyway, but better to be explicit.
      
      Also, in the server, support clients that don't send an Initial Client
      response in the first SASLInitialResponse message. The server is supposed
      to first send an empty request in that case, to which the client will
      respond with the data that usually comes in the Initial Client Response.
      libpq uses the Initial Client Response field and doesn't need this, and I
      would assume any other sensible implementation to use Initial Client
      Response, too, but let's follow the SASL spec.
      
      Improve the documentation on SASL authentication in protocol. Add a
      section describing the SASL message flow, and some details on our
      SCRAM-SHA-256 implementation.
      
      Document the different kinds of PasswordMessages that the frontend sends
      in different phases of SASL authentication, as well as GSS/SSPI
      authentication as separate message formats. Even though they're all 'p'
      messages, and the exact format depends on the context, describing them as
      separate message formats makes the documentation more clear.
      
      Reviewed by Michael Paquier and Álvaro Hernández Tortosa.
      
      Discussion: https://www.postgresql.org/message-id/CAB7nPqS-aFg0iM3AQOJwKDv_0WkAedRjs1W2X8EixSz+sKBXCQ@mail.gmail.com
      4f3b87ab
    • Heikki Linnakangas's avatar
      Refactor libpq authentication request processing. · 61bf96ca
      Heikki Linnakangas authored
      Move the responsibility of reading the data from the authentication request
      message from PQconnectPoll() to pg_fe_sendauth(). This way, PQconnectPoll()
      doesn't need to know about all the different authentication request types,
      and we don't need the extra fields in the pg_conn struct to pass the data
      from PQconnectPoll() to pg_fe_sendauth() anymore.
      
      Reviewed by Michael Paquier.
      
      Discussion: https://www.postgresql.org/message-id/6490b975-5ee1-6280-ac1d-af975b19fb9a%40iki.fi
      61bf96ca
    • Tom Lane's avatar
      Move bootstrap-time lookup of regproc OIDs into genbki.pl. · 5e39f06c
      Tom Lane authored
      Formerly, the bootstrap backend looked up the OIDs corresponding to
      names in regproc catalog entries using brute-force searches of pg_proc.
      It was somewhat remarkable that that worked at all, since it was used
      while populating other pretty-fundamental catalogs like pg_operator.
      And it was also quite slow, and getting slower as pg_proc gets bigger.
      
      This patch moves the lookup work into genbki.pl, so that the values in
      postgres.bki for regproc columns are always numeric OIDs, an option
      that regprocin() already supported.  Perl isn't the world's speediest
      language, so this about doubles the time needed to run genbki.pl (from
      0.3 to 0.6 sec on my machine).  But we only do that at most once per
      build.  The time needed to run initdb drops significantly --- on my
      machine, initdb --no-sync goes from 1.8 to 1.3 seconds.  So this is
      a small net win even for just one initdb per build, and it becomes
      quite a nice win for test sequences requiring many initdb runs.
      
      Strip out the now-dead code for brute-force catalog searching in
      regprocin.  We'd also cargo-culted similar logic into regoperin
      and some (not all) of the other reg*in functions.  That is all
      dead code too since we currently have no need to load such values
      during bootstrap.  I removed it all, reasoning that if we ever
      need such functionality it'd be much better to do it in a similar
      way to this patch.
      
      There might be some simplifications possible in the backend now that
      regprocin doesn't require doing catalog reads so early in bootstrap.
      I've not looked into that, though.
      
      Andreas Karlsson, with some small adjustments by me
      
      Discussion: https://postgr.es/m/30896.1492006367@sss.pgh.pa.us
      5e39f06c
    • Peter Eisentraut's avatar
      pg_dump: Always dump subscriptions NOCONNECT · a9254e67
      Peter Eisentraut authored
      This removes the pg_dump option --no-subscription-connect and makes it
      the default.  Dumping a subscription so that it activates right away
      when restored is not very useful, because the state of the publication
      server is unclear.
      
      Discussion: https://www.postgresql.org/message-id/e4fbfad5-c6ac-fd50-6777-18c84b34eb2f@2ndquadrant.com
      a9254e67
    • Peter Eisentraut's avatar
      pg_dump: Dump subscriptions by default · c31671f9
      Peter Eisentraut authored
      Dump subscriptions if the current user is a superuser, otherwise write a
      warning and skip them.  Remove the pg_dump option
      --include-subscriptions.
      
      Discussion: https://www.postgresql.org/message-id/e4fbfad5-c6ac-fd50-6777-18c84b34eb2f@2ndquadrant.com
      c31671f9
Loading