1. 22 Apr, 2017 2 commits
  2. 21 Apr, 2017 6 commits
    • Peter Eisentraut's avatar
      doc: Update link · f58b6643
      Peter Eisentraut authored
      The reference "That is the topic of the next section." has been
      incorrect since the materialized views documentation got inserted
      between the section "rules-views" and "rules-update".
      
      Author: Zertrin <postgres_wiki@zertrin.org>
      f58b6643
    • Tom Lane's avatar
      Avoid depending on non-POSIX behavior of fcntl(2). · 3e51725b
      Tom Lane authored
      The POSIX standard does not say that the success return value for
      fcntl(F_SETFD) and fcntl(F_SETFL) is zero; it says only that it's not -1.
      We had several calls that were making the stronger assumption.  Adjust
      them to test specifically for -1 for strict spec compliance.
      
      The standard further leaves open the possibility that the O_NONBLOCK
      flag bit is not the only active one in F_SETFL's argument.  Formally,
      therefore, one ought to get the current flags with F_GETFL and store
      them back with only the O_NONBLOCK bit changed when trying to change
      the nonblock state.  In port/noblock.c, we were doing the full pushup
      in pg_set_block but not in pg_set_noblock, which is just weird.  Make
      both of them do it properly, since they have little business making
      any assumptions about the socket they're handed.  The other places
      where we're issuing F_SETFL are working with FDs we just got from
      pipe(2), so it's reasonable to assume the FDs' properties are all
      default, so I didn't bother adding F_GETFL steps there.
      
      Also, while pg_set_block deserves some points for trying to do things
      right, somebody had decided that it'd be even better to cast fcntl's
      third argument to "long".  Which is completely loony, because POSIX
      clearly says the third argument for an F_SETFL call is "int".
      
      Given the lack of field complaints, these missteps apparently are not
      of significance on any common platforms.  But they're still wrong,
      so back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/30882.1492800880@sss.pgh.pa.us
      3e51725b
    • Heikki Linnakangas's avatar
      Change the on-disk format of SCRAM verifiers to conform to RFC 5803. · 68e61ee7
      Heikki Linnakangas authored
      It doesn't make any immediate difference to PostgreSQL, but might as well
      follow the standard, since one exists. (I looked at RFC 5803 earlier, but
      didn't fully understand it back then.)
      
      The new format uses Base64 instead of hex to encode StoredKey and
      ServerKey, which makes the verifiers slightly smaller. Using the same
      encoding for the salt and the keys also means that you only need one
      encoder/decoder instead of two. Although we have code in the backend to
      do both, we are talking about teaching libpq how to create SCRAM verifiers
      for PQencodePassword(), and libpq doesn't currently have any code for hex
      encoding.
      
      Bump catversion, because this renders any existing SCRAM verifiers in
      pg_authid invalid.
      
      Discussion: https://www.postgresql.org/message-id/351ba574-85ea-d9b8-9689-8c928dd0955d@iki.fi
      68e61ee7
    • Peter Eisentraut's avatar
      doc: Fix typo · c29a752c
      Peter Eisentraut authored
      c29a752c
    • Tom Lane's avatar
      Remove long-obsolete catering for platforms without F_SETFD/FD_CLOEXEC. · 536d47bd
      Tom Lane authored
      SUSv2 mandates that <fcntl.h> provide both F_SETFD and FD_CLOEXEC,
      so it seems pretty unlikely that any platforms remain without those.
      Remove the #ifdef-ery installed by commit 7627b91c to see if the
      buildfarm agrees.
      
      Discussion: https://postgr.es/m/21444.1492798101@sss.pgh.pa.us
      536d47bd
    • Peter Eisentraut's avatar
      Synchronize table list before creating slot in CREATE SUBSCRIPTION · dcb39c37
      Peter Eisentraut authored
      This way a failure to synchronize the table list will not leave an
      unused slot on the publisher.
      
      Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      dcb39c37
  3. 20 Apr, 2017 7 commits
    • Tom Lane's avatar
      Add missing erand48.c to libpq/.gitignore. · 77c316be
      Tom Lane authored
      Oversight in commit 818fd4a6.  While at it, sync order of file list
      in .gitignore with those in the Makefile.
      77c316be
    • Alvaro Herrera's avatar
      Improve multivariate statistics documentation · 919f6d74
      Alvaro Herrera authored
      Extended statistics commit 7b504eb2 did not include appropriate
      documentation next to where we document regular planner statistics (I
      ripped what was submitted before commit and then forgot to put it back),
      and while later commit 2686ee1b added some material, it structurally
      depended on what I had ripped out, so the end result wasn't proper.
      
      Fix those problems by shuffling what was added by 2686ee1b and
      including some additional material, so that now chapter 14 "Performance
      Tips" now describes the types of multivariate statistics we currently
      have, and chapter 68 "How the Planner Uses Statistics" shows some
      examples.  The new text should be more in line with previous material,
      in (hopefully) the appropriate depth.
      
      While at it, fix a small bug in pg_statistic_ext docs: one column was
      listed in the wrong spot.
      919f6d74
    • Tom Lane's avatar
      Sync pg_ctl documentation and usage message with reality. · 8bcb31ad
      Tom Lane authored
      Commit 05cd12ed ("pg_ctl: Change default to wait for all actions")
      was a tad sloppy about updating the documentation to match.  The
      documentation was also sorely in need of a copy-editing pass, having
      been adjusted at different times by different people who took little
      care to maintain consistency of style.
      8bcb31ad
    • Peter Eisentraut's avatar
      Modify message when partitioned table is added to publication · 594b526b
      Peter Eisentraut authored
      Give a more specific error message than "xyz is not a table".
      
      Also document in CREATE PUBLICATION which kinds of relations are not
      supported.
      
      based on patch by Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
      594b526b
    • Fujii Masao's avatar
      Prevent log_replication_commands from causing SQL commands to be logged. · 3a66581d
      Fujii Masao authored
      Commit 7c4f5240 allowed walsender to execute normal SQL commands
      to support table sync feature in logical replication. Previously
      while log_statement caused such SQL commands to be logged,
      log_replication_commands caused them to be logged, too.
      That is, such SQL commands were logged twice unexpectedly
      when those settings were both enabled.
      
      This commit forces log_replication_commands to log only replication
      commands, to prevent normal SQL commands from being logged twice.
      
      Author: Masahiko Sawada
      Reviewed-by: Kyotaro Horiguchi
      Reported-by: Fujii Masao
      Discussion: http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=ZOSY3kX_Pna9R9SA@mail.gmail.com
      3a66581d
    • Fujii Masao's avatar
      Mark some columns in pg_subscription as NOT NULL. · 88b0a319
      Fujii Masao authored
      In pg_subscription, subconninfo, subslotname, subsynccommit and
      subpublications are expected not to be NULL. Therefore this patch
      adds BKI_FORCE_NOT_NULL markings to them.
      
      This patch is basically unnecessary unless the code has a bug which
      wrongly sets either of those columns to NULL. But it's good to have
      this as a safeguard.
      
      Author: Masahiko Sawada
      Reviewed-by: Kyotaro Horiguchi
      Reported-by: Fujii Masao
      Discussion: http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=ZOSY3kX_Pna9R9SA@mail.gmail.com
      88b0a319
    • Fujii Masao's avatar
      Don't call the function that may raise an error while holding spinlock. · 8bbc618b
      Fujii Masao authored
      It's not safe to raise an error while holding spinlock. But previously
      logical replication worker for table sync called the function which
      reads the system catalog and may raise an error while it's holding
      spinlock. Which could lead to the trouble where spinlock will never
      be released and the server gets stuck infinitely.
      
      Author: Petr Jelinek
      Reviewed-by: Kyotaro Horiguchi and Fujii Masao
      Reported-by: Fujii Masao
      Discussion: http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=ZOSY3kX_Pna9R9SA@mail.gmail.com
      8bbc618b
  4. 19 Apr, 2017 1 commit
  5. 18 Apr, 2017 16 commits
  6. 17 Apr, 2017 8 commits