Skip to content
Snippets Groups Projects
  1. Jun 24, 2016
  2. Jun 20, 2016
    • Tom Lane's avatar
      pg_trgm's set_limit() function is parallel unsafe, not parallel restricted. · e611515d
      Tom Lane authored
      Per buildfarm.  Fortunately, it's not quite too late to squeeze this fix
      into the pg_trgm 1.3 update.
      e611515d
    • Tom Lane's avatar
      Fix comparison of similarity to threshold in GIST trigram searches. · 9c852566
      Tom Lane authored
      There was some very strange code here, dating to commit b525bf77, that
      purported to work around an ancient gcc bug by forcing a float4 comparison
      to be done as int instead.  Commit 5871b884 broke that when it changed
      one side of the comparison to "double" but left the comparison code alone.
      Commit f576b17c doubled down on the weirdness by introducing a "volatile"
      marker, which had nothing to do with the actual problem.
      
      Guess that the gcc bug, even if it's still present in the wild, was
      triggered by comparison of float4's and can be avoided if we store the
      result of cnt_sml() into a double before comparing to the double "nlimit".
      This will at least work correctly on non-broken compilers, and it's way
      more readable.
      
      Per bug #14202 from Greg Navis.  Add a regression test based on his
      example.
      
      Report: <20160620115321.5792.10766@wrigleys.postgresql.org>
      9c852566
  3. Jun 18, 2016
    • Tom Lane's avatar
      Fix parallel-safety markings for contrib/dblink. · 7e81a18d
      Tom Lane authored
      As shown by buildfarm reports, dblink_build_sql_insert and
      dblink_build_sql_update are *not* parallel safe, because they
      may attempt to access temporary tables of the local session.
      
      Although dblink_build_sql_delete doesn't actually touch the
      contents of the referenced table, it seems consistent and prudent
      to mark it PARALLEL RESTRICTED too.
      7e81a18d
  4. Jun 17, 2016
    • Robert Haas's avatar
      pg_visibility: Add pg_truncate_visibility_map function. · 71d05a2c
      Robert Haas authored
      This requires some core changes as well so that we can properly
      WAL-log the truncation.  Specifically, it changes the format of the
      XLOG_SMGR_TRUNCATE WAL record, so bump XLOG_PAGE_MAGIC.
      
      Patch by me, reviewed but not fully endorsed by Andres Freund.
      71d05a2c
    • Robert Haas's avatar
      Update dblink extension for parallel query. · 20eb2731
      Robert Haas authored
      Almost all functions provided by this extension are PARALLEL
      RESTRICTED.  Mostly, that's because the leader's TCP connections won't
      be shared with the workers, but in some cases like dblink_get_pkey
      it's because they obtain locks which might be released early if taken
      within a parallel worker.  dblink_fdw_validator probably can't be used
      in a query anyway, but there would be no problem from the point of
      view of parallel query if it were, so it's PARALLEL SAFE.
      
      Andreas Karlsson
      20eb2731
    • Robert Haas's avatar
      postgres_fdw: Rephrase comment. · 177c56d6
      Robert Haas authored
      Per gripe from Thomas Munro, who only complained about a more
      localized problem, but I couldn't resist a bit more wordsmithing.
      177c56d6
  5. Jun 15, 2016
    • Robert Haas's avatar
      Add integrity-checking functions to pg_visibility. · e472ce96
      Robert Haas authored
      The new pg_check_visible() and pg_check_frozen() functions can be used to
      verify that the visibility map bits for a relation's data pages match the
      actual state of the tuples on those pages.
      
      Amit Kapila and Robert Haas, reviewed (in earlier versions) by Andres
      Freund.  Additional testing help by Thomas Munro.
      e472ce96
  6. Jun 14, 2016
    • Robert Haas's avatar
      Update xml2 extension for parallel query. · 13e74531
      Robert Haas authored
      All functions provided by this extension are PARALLEL SAFE.
      
      Andreas Karlsson
      13e74531
    • Robert Haas's avatar
      Update uuid-ossp extension for parallel query. · 20f6c3a2
      Robert Haas authored
      All functions provided by this extension are PARALLEL SAFE.
      
      Andreas Karlsson
      20f6c3a2
    • Robert Haas's avatar
      Update unaccent extension for parallel query. · 202ac08c
      Robert Haas authored
      All functions provided by this extension are PARALLEL SAFE.
      
      Andreas Karlsson
      202ac08c
    • Robert Haas's avatar
      Update sslinfo extension for parallel query. · 6b7d11ff
      Robert Haas authored
      All functions provided by this extension are PARALLEL RESTRICTED,
      because they provide information about the connection state.  Parallel
      workers don't have this information and therefore these functions
      can't be executed in a worker (but they can be present in a query some
      other part of which uses parallelism).
      
      Andreas Karlsson
      6b7d11ff
    • Robert Haas's avatar
      Update extensions with GIN/GIST support for parallel query. · 2910fc82
      Robert Haas authored
      Commit 749a787c bumped the extension
      version on all of these extensions already, and we haven't had a
      release since then, so we can make further changes without bumping the
      extension version again.  Take this opportunity to mark all of the
      functions exported by these modules PARALLEL SAFE -- except for
      pg_trgm's set_limit().  Mark that one PARALLEL RESTRICTED, because it
      makes a persistent change to a GUC value.
      
      Note that some of the markings added by this commit don't have any
      effect; for example, gseg_picksplit() isn't likely to be mentioned
      explicitly in a query and therefore it's parallel-safety marking will
      never be consulted.  But this commit just marks everything for
      consistency: if it were somehow used in a query, that would be fine as
      far as parallel query is concerned, since it does not consult any
      backend-private state, attempt to write data, etc.
      
      Andreas Karlsson, with a few revisions by me.
      2910fc82
    • Robert Haas's avatar
      postgres_fdw: Check PlaceHolderVars before pushing down a join. · 131c7e70
      Robert Haas authored
      As discovered by Andreas Seltenreich via sqlsmith, it's possible for a
      remote join to need to generate a target list which contains a
      PlaceHolderVar which would need to be evaluated on the remote server.
      This happens when we try to push down a join tree which contains outer
      joins and the nullable side of the join contains a subquery which
      evauates some expression which can go to NULL above the level of the
      join.  Since the deparsing logic can't build a remote query that
      involves subqueries, it fails while trying to produce an SQL query
      that can be sent to the remote side.  Detect such cases and don't try
      to push down the join at all.
      
      It's actually fine to push down the join if the PlaceHolderVar needs
      to be evaluated at the current join level.  This patch makes a small
      change to build_tlist_to_deparse so that this case will work.
      
      Amit Langote, Ashutosh Bapat, and me.
      131c7e70
    • Tom Lane's avatar
      Minor fixes in contrib installation scripts. · 5484c0a9
      Tom Lane authored
      Extension scripts should never use CREATE OR REPLACE for initial object
      creation.  If there is a collision with a pre-existing (probably
      user-created) object, we want extension installation to fail, not silently
      overwrite the user's object.  Bloom and sslinfo both violated this precept.
      
      Also fix a number of scripts that had no standard header (the file name
      comment and the \echo...\quit guard).  Probably the \echo...\quit hack
      is less important now than it was in 9.1 days, but that doesn't mean
      that individual extensions get to choose whether to use it or not.
      
      And fix a couple of evident copy-and-pasteos in file name comments.
      
      No need for back-patch: the REPLACE bugs are both new in 9.6, and the
      rest of this is pretty much cosmetic.
      
      Andreas Karlsson and Tom Lane
      5484c0a9
    • Robert Haas's avatar
      postgres_fdw: Promote an Assert() to elog(). · 332fdbef
      Robert Haas authored
      Andreas Seltenreich reports that it is possible for a PlaceHolderVar
      to creep into this tlist, and I fear that even after that's fixed we
      might have other, similar bugs in this area either now or in the
      future.  There's a lot of action-at-a-distance here, because the
      validity of this assertion depends on core planner behavior; so, let's
      use elog() to make sure we catch this even in non-assert builds,
      rather than just crashing.
      332fdbef
  7. Jun 12, 2016
  8. Jun 10, 2016
  9. Jun 09, 2016
  10. Jun 07, 2016
  11. Jun 05, 2016
    • Tom Lane's avatar
      Properly initialize SortSupport for ORDER BY rechecks in nodeIndexscan.c. · 8a859691
      Tom Lane authored
      Fix still another bug in commit 35fcb1b3: it failed to fully initialize
      the SortSupport states it introduced to allow the executor to re-check
      ORDER BY expressions containing distance operators.  That led to a null
      pointer dereference if the sortsupport code tried to use ssup_cxt.  The
      problem only manifests in narrow cases, explaining the lack of previous
      field reports.  It requires a GiST-indexable distance operator that lacks
      SortSupport and is on a pass-by-ref data type, which among core+contrib
      seems to be only btree_gist's interval opclass; and it requires the scan
      to be done as an IndexScan not an IndexOnlyScan, which explains how
      btree_gist's regression test didn't catch it.  Per bug #14134 from
      Jihyun Yu.
      
      Peter Geoghegan
      
      Report: <20160511154904.2603.43889@wrigleys.postgresql.org>
      8a859691
  12. Jun 04, 2016
  13. Jun 03, 2016
    • Tom Lane's avatar
      Measure Bloom index signature-length reloption in bits, not words. · ee4af347
      Tom Lane authored
      Per discussion, this is a more understandable and future-proof way of
      exposing the setting to users.  On-disk, we can still store it in words,
      so as to not break on-disk compatibility with beta1.
      
      Along the way, clean up the code associated with Bloom reloptions.
      Provide explicit macros for default and maximum lengths rather than
      having magic numbers buried in multiple places in the code.  Drop
      the adjustBloomOptions() code altogether: it was useless in view of
      the fact that reloptions.c already performed default-substitution and
      range checking for the options.  Rename a couple of macros and types
      for more clarity.
      
      Discussion: <23767.1464926580@sss.pgh.pa.us>
      ee4af347
  14. May 25, 2016
    • Tom Lane's avatar
      Fix contrib/bloom to work for unlogged indexes. · abaffa90
      Tom Lane authored
      blbuildempty did not do even approximately the right thing: it tried
      to add a metapage to the relation's regular data fork, which already
      has one at that point.  It should look like the ambuildempty methods
      for all the standard index types, ie, initialize a metapage image in
      some transient storage and then write it directly to the init fork.
      To support that, refactor BloomInitMetapage into two functions.
      
      In passing, fix BloomInitMetapage so it doesn't leave the rd_options
      field of the index's relcache entry pointing at transient storage.
      I'm not sure this had any visible consequence, since nothing much
      else is likely to look at a bloom index's rd_options, but it's
      certainly poor practice.
      
      Per bug #14155 from Zhou Digoal.
      
      Report: <20160524144146.22598.42558@wrigleys.postgresql.org>
      abaffa90
Loading