Skip to content
Snippets Groups Projects
  1. Oct 01, 2012
    • Tom Lane's avatar
      Provide some static-assertion functionality on all compilers. · 0d0aa5d2
      Tom Lane authored
      On reflection (especially after noticing how many buildfarm critters have
      __builtin_types_compatible_p but not _Static_assert), it seems like we
      ought to try a bit harder to make these macros do something everywhere.
      The initial cut at it would have been no help to code that is compiled only
      on platforms without _Static_assert, for instance; and in any case not all
      our contributors do their initial coding on the latest gcc version.
      
      Some googling about static assertions turns up quite a bit of prior art
      for making it work in compilers that lack _Static_assert.  The method
      that seems closest to our needs involves defining a struct with a bit-field
      that has negative width if the assertion condition fails.  There seems no
      reliable way to get the error message string to be output, but throwing a
      compile error with a confusing message is better than missing the problem
      altogether.
      
      In the same spirit, if we don't have __builtin_types_compatible_p we can at
      least insist that the variable have the same width as the type.  This won't
      catch errors such as "wrong pointer type", but it's far better than
      nothing.
      
      In addition to changing the macro definitions, adjust a
      compile-time-constant Assert in contrib/hstore to use StaticAssertStmt,
      so we can get some buildfarm coverage on whether that macro behaves sanely
      or not.  There's surely more places that could be converted, but this is
      the first one I came across.
      0d0aa5d2
  2. 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
  3. Aug 28, 2012
    • Tom Lane's avatar
      Remove hstore--1.0.sql. · 9db098df
      Tom Lane authored
      Since we're not installing this file anymore, it has no reason to exist,
      other than as historical reference; but we have an SCM for that.
      9db098df
  4. Jul 16, 2012
    • Peter Eisentraut's avatar
      Remove unreachable code · dd16f948
      Peter Eisentraut authored
      The Solaris Studio compiler warns about these instances, unlike more
      mainstream compilers such as gcc.  But manual inspection showed that
      the code is clearly not reachable, and we hope no worthy compiler will
      complain about removing this code.
      dd16f948
  5. Jun 25, 2012
    • Peter Eisentraut's avatar
      Replace int2/int4 in C code with int16/int32 · b8b2e3b2
      Peter Eisentraut authored
      The latter was already the dominant use, and it's preferable because
      in C the convention is that intXX means XX bits.  Therefore, allowing
      mixed use of int2, int4, int8, int16, int32 is obviously confusing.
      
      Remove the typedefs for int2 and int4 for now.  They don't seem to be
      widely used outside of the PostgreSQL source tree, and the few uses
      can probably be cleaned up by the time this ships.
      b8b2e3b2
  6. Apr 24, 2012
  7. Feb 23, 2012
    • Robert Haas's avatar
      Don't install hstore--1.0.sql any more. · d4fb2f99
      Robert Haas authored
      Since the current version is 1.1, the 1.0 file isn't really needed.  We do
      need the 1.0--1.1 upgrade file, so people on 1.0 can upgrade.
      
      Per recent discussion on pgsql-hackers.
      d4fb2f99
  8. Feb 14, 2012
    • Tom Lane's avatar
      Preserve column names in the execution-time tupledesc for a RowExpr. · 398f70ec
      Tom Lane authored
      The hstore and json datatypes both have record-conversion functions that
      pay attention to column names in the composite values they're handed.
      We used to not worry about inserting correct field names into tuple
      descriptors generated at runtime, but given these examples it seems
      useful to do so.  Observe the nicer-looking results in the regression
      tests whose results changed.
      
      catversion bump because there is a subtle change in requirements for stored
      rule parsetrees: RowExprs from ROW() constructs now have to include field
      names.
      
      Andrew Dunstan and Tom Lane
      398f70ec
  9. Nov 08, 2011
    • Robert Haas's avatar
      Fix hstore regression tests. · bb1afb52
      Robert Haas authored
      This was an oversight in commit b60653bc.
      
      Also, fix a typo spotted by Thom Brown.
      bb1afb52
    • Robert Haas's avatar
      Remove hstore's text => text operator. · b60653bc
      Robert Haas authored
      Since PostgreSQL 9.0, we've emitted a warning message when an operator
      named => is created, because the SQL standard now reserves that token
      for another use.  But we've also shipped such an operator with hstore.
      Use of the function hstore(text, text) has been recommended in
      preference to =>(text, text).  Per discussion, it's now time to take
      the next step and stop shipping the operator.  This will allow us to
      prohibit the use of => as an operator name in a future release if and
      when we wish to support the SQL standard use of this token.
      
      The release notes should mention this incompatibility.
      
      Patch by me, reviewed by David Wheeler, Dimitri Fontaine and Tom Lane.
      b60653bc
  10. 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
  11. Sep 11, 2011
    • Peter Eisentraut's avatar
      Remove many -Wcast-qual warnings · 1b81c2fe
      Peter Eisentraut authored
      This addresses only those cases that are easy to fix by adding or
      moving a const qualifier or removing an unnecessary cast.  There are
      many more complicated cases remaining.
      1b81c2fe
  12. Sep 01, 2011
  13. 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
  14. Apr 10, 2011
  15. Feb 15, 2011
  16. 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
  17. Jan 24, 2011
  18. Jan 09, 2011
    • Tom Lane's avatar
      Update contrib/hstore for new GIN extractQuery API. · ba398969
      Tom Lane authored
      In particular, make hstore @> '' succeed for all hstores, likewise
      hstore ?& '{}'.  Previously the results were inconsistent and could
      depend on whether you were using a GiST index, GIN index, or seqscan.
      ba398969
  19. Jan 08, 2011
    • Tom Lane's avatar
      Fix GIN to support null keys, empty and null items, and full index scans. · 73912e7f
      Tom Lane authored
      Per my recent proposal(s).  Null key datums can now be returned by
      extractValue and extractQuery functions, and will be stored in the index.
      Also, placeholder entries are made for indexable items that are NULL or
      contain no keys according to extractValue.  This means that the index is
      now always complete, having at least one entry for every indexed heap TID,
      and so we can get rid of the prohibition on full-index scans.  A full-index
      scan is implemented much the same way as partial-match scans were already:
      we build a bitmap representing all the TIDs found in the index, and then
      drive the results off that.
      
      Also, introduce a concept of a "search mode" that can be requested by
      extractQuery when the operator requires matching to empty items (this is
      just as cheap as matching to a single key) or requires a full index scan
      (which is not so cheap, but it sure beats failing or giving wrong answers).
      The behavior remains backward compatible for opclasses that don't return
      any null keys or request a non-default search mode.
      
      Using these features, we can now make the GIN index opclass for anyarray
      behave in a way that matches the actual anyarray operators for &&, <@, @>,
      and = ... which it failed to do before in assorted corner cases.
      
      This commit fixes the core GIN code and ginarrayprocs.c, updates the
      documentation, and adds some simple regression test cases for the new
      behaviors using the array operators.  The tsearch and contrib GIN opclass
      support functions still need to be looked over and probably fixed.
      
      Another thing I intend to fix separately is that this is pretty inefficient
      for cases where more than one scan condition needs a full-index search:
      we'll run duplicate GinScanEntrys, each one of which builds a large bitmap.
      There is some existing logic to merge duplicate GinScanEntrys but it needs
      refactoring to make it work for entries belonging to different scan keys.
      
      Note that most of gin.h has been split out into a new file gin_private.h,
      so that gin.h doesn't export anything that's not supposed to be used by GIN
      opclasses or the rest of the backend.  I did quite a bit of other code
      beautification work as well, mostly fixing comments and choosing more
      appropriate names for things.
      73912e7f
  20. Dec 22, 2010
  21. Nov 23, 2010
  22. Sep 22, 2010
  23. Sep 20, 2010
  24. Sep 16, 2010
    • Tom Lane's avatar
      Fix two new-in-9.0 bugs in hstore. · cd55aa2e
      Tom Lane authored
      There was an incorrect Assert in hstoreValidOldFormat(), which would cause
      immediate core dumps when attempting to work with pre-9.0 hstore data,
      but of course only in an assert-enabled build.
      
      Also, ghstore_decompress() incorrectly applied DatumGetHStoreP() to a datum
      that wasn't actually an hstore, but rather a ghstore (ie, a gist signature
      bitstring).  That used to be harmless, but could now result in misbehavior
      if the hstore format conversion code happened to trigger.  In reality,
      since ghstore is not marked toastable (and doesn't need to be), this
      function is useless anyway; we can lobotomize it down to returning the
      passed-in pointer.
      
      Both bugs found by Andrew Gierth, though this isn't exactly his proposed
      patch.
      cd55aa2e
  25. Jul 20, 2010
  26. Jul 02, 2010
  27. Jun 22, 2010
  28. Jun 18, 2010
  29. Jun 15, 2010
  30. Feb 26, 2010
  31. Sep 30, 2009
    • Tom Lane's avatar
      Fix bogus Assert, per buildfarm results. · f7082f26
      Tom Lane authored
      f7082f26
    • Tom Lane's avatar
      Assorted improvements in contrib/hstore. · 172eacba
      Tom Lane authored
      Remove the 64K limit on the lengths of keys and values within an hstore.
      (This changes the on-disk format, but the old format can still be read.)
      Add support for btree/hash opclasses for hstore --- this is not so much
      for actual indexing purposes as to allow use of GROUP BY, DISTINCT, etc.
      Add various other new functions and operators.
      
      Andrew Gierth
      172eacba
  32. Jun 11, 2009
  33. Apr 02, 2009
  34. Mar 25, 2009
    • Tom Lane's avatar
      Adjust the APIs for GIN opclass support functions to allow the extractQuery() · 87b8db37
      Tom Lane authored
      method to pass extra data to the consistent() and comparePartial() methods.
      This is the core infrastructure needed to support the soon-to-appear
      contrib/btree_gin module.  The APIs are still upward compatible with the
      definitions used in 8.3 and before, although *not* with the previous 8.4devel
      function definitions.
      
      catversion bump for changes in pg_proc entries (although these are just
      cosmetic, since GIN doesn't actually look at the function signature before
      calling it...)
      
      Teodor Sigaev and Oleg Bartunov
      87b8db37
  35. Mar 15, 2009
Loading