Skip to content
Snippets Groups Projects
  1. May 29, 2013
  2. Mar 22, 2013
    • Tom Lane's avatar
      Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely. · 8a3b6772
      Tom Lane authored
      If the remote database's settings of these GUCs are different from ours,
      ambiguous datetime values may be read incorrectly.  To fix, temporarily
      adopt the remote server's settings while we ingest a query result.
      
      This is not a complete fix, since it doesn't do anything about ambiguous
      values in commands sent to the remote server; but there seems little we
      can do about that end of it given dblink's entirely textual API for
      transmitted commands.
      
      Back-patch to 9.2.  The hazard exists in all versions, but this patch
      would need more work to apply before 9.2.  Given the lack of field
      complaints about this issue, it doesn't seem worth the effort at present.
      
      Daniel Farina and Tom Lane
      8a3b6772
  3. Jan 01, 2013
  4. Dec 11, 2012
    • Andrew Dunstan's avatar
      Add mode where contrib installcheck runs each module in a separately named database. · ad69bd05
      Andrew Dunstan authored
      Normally each module is tested in a database named contrib_regression,
      which is dropped and recreated at the beginhning of each pg_regress run.
      This new mode, enabled by adding USE_MODULE_DB=1 to the make command
      line, runs most modules in a database with the module name embedded in
      it.
      
      This will make testing pg_upgrade on clusters with the contrib modules
      a lot easier.
      
      Second attempt at this, this time accomodating make versions older
      than 3.82.
      
      Still to be done: adapt to the MSVC build system.
      
      Backpatch to 9.0, which is the earliest version it is reasonably
      possible to test upgrading from.
      ad69bd05
  5. Dec 03, 2012
  6. Dec 02, 2012
    • Andrew Dunstan's avatar
      Add mode where contrib installcheck runs each module in a separately named database. · e2b3c21b
      Andrew Dunstan authored
      Normally each module is tested in aq database named contrib_regression,
      which is dropped and recreated at the beginhning of each pg_regress run.
      This mode, enabled by adding USE_MODULE_DB=1 to the make command line,
      runs most modules in a database with the module name embedded in it.
      
      This will make testing pg_upgrade on clusters with the contrib modules
      a lot easier.
      
      Still to be done: adapt to the MSVC build system.
      
      Backpatch to 9.0, which is the earliest version it is reasonably possible
      to test upgrading from.
      e2b3c21b
  7. Oct 11, 2012
  8. Oct 10, 2012
    • Tom Lane's avatar
      Create an improved FDW option validator function for contrib/dblink. · 8255566f
      Tom Lane authored
      dblink now has its own validator function dblink_fdw_validator(), which is
      better than the core function postgresql_fdw_validator() because it gets
      the list of legal options from libpq instead of having a hard-wired list.
      
      Make the dblink extension module provide a standard foreign data wrapper
      dblink_fdw that encapsulates use of this validator, and recommend use of
      that wrapper instead of making up wrappers on the fly.
      
      Unfortunately, because ad-hoc wrappers *were* recommended practice
      previously, it's not clear when we can get rid of postgresql_fdw_validator
      without causing upgrade problems.  But this is a step in the right
      direction.
      
      Shigeru Hanada, reviewed by KaiGai Kohei
      8255566f
  9. Aug 30, 2012
    • Alvaro Herrera's avatar
      Split tuple struct defs from htup.h to htup_details.h · c219d9b0
      Alvaro Herrera authored
      This reduces unnecessary exposure of other headers through htup.h, which
      is very widely included by many files.
      
      I have chosen to move the function prototypes to the new file as well,
      because that means htup.h no longer needs to include tupdesc.h.  In
      itself this doesn't have much effect in indirect inclusion of tupdesc.h
      throughout the tree, because it's also required by execnodes.h; but it's
      something to explore in the future, and it seemed best to do the htup.h
      change now while I'm busy with it.
      c219d9b0
  10. Aug 29, 2012
  11. Aug 02, 2012
    • Tom Lane's avatar
      Replace libpq's "row processor" API with a "single row" mode. · 41b9c845
      Tom Lane authored
      After taking awhile to digest the row-processor feature that was added to
      libpq in commit 92785dac, we've concluded
      it is over-complicated and too hard to use.  Leave the core infrastructure
      changes in place (that is, there's still a row processor function inside
      libpq), but remove the exposed API pieces, and instead provide a "single
      row" mode switch that causes PQgetResult to return one row at a time in
      separate PGresult objects.
      
      This approach incurs more overhead than proper use of a row processor
      callback would, since construction of a PGresult per row adds extra cycles.
      However, it is far easier to use and harder to break.  The single-row mode
      still affords applications the primary benefit that the row processor API
      was meant to provide, namely not having to accumulate large result sets in
      memory before processing them.  Preliminary testing suggests that we can
      probably buy back most of the extra cycles by micro-optimizing construction
      of the extra results, but that task will be left for another day.
      
      Marko Kreen
      41b9c845
  12. Jul 05, 2012
  13. Jun 10, 2012
  14. Apr 24, 2012
  15. Apr 05, 2012
    • Tom Lane's avatar
      Improve efficiency of dblink by using libpq's new row processor API. · 6f922ef8
      Tom Lane authored
      This patch provides a test case for libpq's row processor API.
      contrib/dblink can deal with very large result sets by dumping them into
      a tuplestore (which can spill to disk) --- but until now, the intermediate
      storage of the query result in a PGresult meant memory bloat for any large
      result.  Now we use a row processor to convert the data to tuple form and
      dump it directly into the tuplestore.
      
      A limitation is that this only works for plain dblink() queries, not
      dblink_send_query() followed by dblink_get_result().  In the latter
      case we don't know the desired tuple rowtype soon enough.  While hack
      solutions to that are possible, a different user-level API would
      probably be a better answer.
      
      Kyotaro Horiguchi, reviewed by Marko Kreen and Tom Lane
      6f922ef8
  16. Apr 04, 2012
    • Tom Lane's avatar
      Fix a couple of contrib/dblink bugs. · d843ed21
      Tom Lane authored
      dblink_exec leaked temporary database connections if any error occurred
      after connection setup, for example
      	SELECT dblink_exec('...connect string...', 'select 1/0');
      Add a PG_TRY block to ensure PQfinish gets done when it is needed.
      (dblink_record_internal is on the hairy edge of needing similar treatment,
      but seems not to be actively broken at the moment.)
      
      Also, in 9.0 and up, only one of the three functions using tuplestore
      return mode was properly checking that the query context would allow
      a tuplestore result.
      
      Noted while reviewing dblink patch.  Back-patch to all supported branches.
      d843ed21
  17. Mar 29, 2012
    • Tom Lane's avatar
      Fix dblink's failure to report correct connection name in error messages. · b75fbe91
      Tom Lane authored
      The DBLINK_GET_CONN and DBLINK_GET_NAMED_CONN macros did not set the
      surrounding function's conname variable, causing errors to be incorrectly
      reported as having occurred on the "unnamed" connection in some cases.
      This bug was actually visible in two cases in the regression tests,
      but apparently whoever added those cases wasn't paying attention.
      
      Noted by Kyotaro Horiguchi, though this is different from his proposed
      patch.
      
      Back-patch to 8.4; 8.3 does not have the same type of error reporting
      so the patch is not relevant.
      b75fbe91
  18. Jan 02, 2012
  19. Oct 12, 2011
    • Tom Lane's avatar
      Throw a useful error message if an extension script file is fed to psql. · 458857cc
      Tom Lane authored
      We have seen one too many reports of people trying to use 9.1 extension
      files in the old-fashioned way of sourcing them in psql.  Not only does
      that usually not work (due to failure to substitute for MODULE_PATHNAME
      and/or @extschema@), but if it did work they'd get a collection of loose
      objects not an extension.  To prevent this, insert an \echo ... \quit
      line that prints a suitable error message into each extension script file,
      and teach commands/extension.c to ignore lines starting with \echo.
      That should not only prevent any adverse consequences of loading a script
      file the wrong way, but make it crystal clear to users that they need to
      do it differently now.
      
      Tom Lane, following an idea of Andrew Dunstan's.  Back-patch into 9.1
      ... there is not going to be much value in this if we wait till 9.2.
      458857cc
  20. Sep 01, 2011
  21. Jul 16, 2011
  22. Jul 04, 2011
  23. Jun 26, 2011
  24. Apr 25, 2011
    • Peter Eisentraut's avatar
      Support "make check" in contrib · f8ebe3bc
      Peter Eisentraut authored
      Added a new option --extra-install to pg_regress to arrange installing
      the respective contrib directory into the temporary installation.
      This is currently not yet supported for Windows MSVC builds.
      
      Updated the .gitignore files for contrib modules to ignore the
      leftovers of a temp-install check run.
      
      Changed the exit status of "make check" in a pgxs build (which still
      does nothing) to 0 from 1.
      
      Added "make check" in contrib to top-level "make check-world".
      f8ebe3bc
  25. Feb 14, 2011
    • Tom Lane's avatar
      Avoid use of CREATE OR REPLACE FUNCTION in extension installation files. · 029fac22
      Tom Lane authored
      It was never terribly consistent to use OR REPLACE (because of the lack of
      comparable functionality for data types, operators, etc), and
      experimentation shows that it's now positively pernicious in the extension
      world.  We really want a failure to occur if there are any conflicts, else
      it's unclear what the extension-ownership state of the conflicted object
      ought to be.  Most of the time, CREATE EXTENSION will fail anyway because
      of conflicts on other object types, but an extension defining only
      functions can succeed, with bad results.
      029fac22
    • Tom Lane's avatar
      Convert contrib modules to use the extension facility. · 629b3af2
      Tom Lane authored
      This isn't fully tested as yet, in particular I'm not sure that the
      "foo--unpackaged--1.0.sql" scripts are OK.  But it's time to get some
      buildfarm cycles on it.
      
      sepgsql is not converted to an extension, mainly because it seems to
      require a very nonstandard installation process.
      
      Dimitri Fontaine and Tom Lane
      629b3af2
  26. Jan 01, 2011
  27. Nov 25, 2010
  28. Nov 23, 2010
  29. Nov 20, 2010
    • Robert Haas's avatar
      Expose quote_literal_cstr() from core. · 4343c0e5
      Robert Haas authored
      This eliminates the need for inefficient implementions of this
      functionality in both contrib/dblink and contrib/tablefunc, so remove
      them.  The upcoming patch implementing an in-core format() function
      will also require this functionality.
      
      In passing, add some regression tests.
      4343c0e5
  30. Nov 12, 2010
    • Peter Eisentraut's avatar
      Improved parallel make support · 19e231bb
      Peter Eisentraut authored
      Replace for loops in makefiles with proper dependencies.  Parallel
      make can now span across directories.  Also, make -k and make -q work
      properly.
      
      GNU make 3.80 or newer is now required.
      19e231bb
  31. Sep 22, 2010
  32. Sep 20, 2010
  33. Jul 06, 2010
  34. Jun 15, 2010
    • Tom Lane's avatar
      Change the interpretation of the primary_key_attnums parameter of · c0989c67
      Tom Lane authored
      dblink_build_sql_insert() and related functions.  Now the column numbers
      are treated as logical not physical column numbers.  This will provide saner
      behavior in the presence of dropped columns; furthermore, if we ever get
      around to allowing rearrangement of logical column ordering, the original
      definition would become nearly untenable from a usability standpoint.
      Per recent discussion of dblink's handling of dropped columns.
      Not back-patched for fear of breaking existing applications.
      c0989c67
    • Tom Lane's avatar
      Fix dblink_build_sql_insert() and related functions to handle dropped · 3b3706d2
      Tom Lane authored
      columns correctly.  In passing, get rid of some dead logic in the
      underlying get_sql_insert() etc functions --- there is no caller that
      will pass null value-arrays to them.
      
      Per bug report from Robert Voinea.
      3b3706d2
    • Tom Lane's avatar
      Consolidate and improve checking of key-column-attnum arguments for · 48a72453
      Tom Lane authored
      dblink_build_sql_insert() and related functions.  In particular, be sure to
      reject references to dropped and out-of-range column numbers.  The numbers
      are still interpreted as physical column numbers, though, for backward
      compatibility.
      
      This patch replaces Joe's patch of 2010-02-03, which handled only some aspects
      of the problem.
      48a72453
  35. Jun 14, 2010
    • Tom Lane's avatar
      Rearrange dblink's dblink_build_sql_insert() and related routines to open and · 6bbaa314
      Tom Lane authored
      lock the target relation just once per SQL function call.  The original coding
      obtained and released lock several times per call.  Aside from saving a
      not-insignificant number of cycles, this eliminates possible race conditions
      if someone tries to modify the relation's schema concurrently.  Also
      centralize locking and permission-checking logic.
      
      Problem noted while investigating a trouble report from Robert Voinea --- his
      problem is still to be fixed, though.
      6bbaa314
Loading