Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Feb 21, 2015
  1. Use FLEXIBLE_ARRAY_MEMBER in a number of other places.

    Tom Lane authored
    I think we're about done with this...
Commits on Feb 20, 2015
  1. Use FLEXIBLE_ARRAY_MEMBER in struct RecordIOData.

    Tom Lane authored
    I (tgl) fixed this last night in rowtypes.c, but I missed that the
    code had been copied into a couple of other places.
    Michael Paquier
Commits on Feb 9, 2015
  1. Heikki Linnakangas

    Move pg_crc.c to src/common, and remove pg_crc_tables.h

    hlinnaka authored
    To get CRC functionality in a client program, you now need to link with
    libpgcommon instead of libpgport. The CRC code has nothing to do with
    portability, so libpgcommon is a better home. (libpgcommon didn't exist
    when pg_crc.c was originally moved to src/port.)
    Remove the possibility to get CRC functionality by just #including
    pg_crc_tables.h. I'm not aware of any extensions that actually did that and
    couldn't simply link with libpgcommon.
    This also moves the pg_crc.h header file from src/include/utils to
    src/include/common, which will require changes to any external programs
    that currently does #include "utils/pg_crc.h". That seems acceptable, as
    include/common is clearly the right home for it now, and the change needed
    to any such programs is trivial.
Commits on Jan 13, 2015
  1. Heikki Linnakangas

    Silence Coverity warnings about unused return values from pushJsonbVa…

    hlinnaka authored
    Similar warnings from backend were silenced earlier by commit c831593,
    but there were a few more contrib/hstore.
    Michael Paquier
Commits on Dec 1, 2014
  1. Andrew Dunstan

    Fix hstore_to_json_loose's detection of valid JSON number values.

    adunstan authored
    We expose a function IsValidJsonNumber that internally calls the lexer
    for json numbers. That allows us to use the same test everywhere,
    instead of inventing a broken test for hstore conversions. The new
    function is also used in datum_to_json, replacing the code that is now
    moved to the new function.
    Backpatch to 9.3 where hstore_to_json_loose was introduced.
Commits on Nov 4, 2014
  1. Heikki Linnakangas

    Switch to CRC-32C in WAL and other places.

    hlinnaka authored
    The old algorithm was found to not be the usual CRC-32 algorithm, used by
    Ethernet et al. We were using a non-reflected lookup table with code meant
    for a reflected lookup table. That's a strange combination that AFAICS does
    not correspond to any bit-wise CRC calculation, which makes it difficult to
    reason about its properties. Although it has worked well in practice, seems
    safer to use a well-known algorithm.
    Since we're changing the algorithm anyway, we might as well choose a
    different polynomial. The Castagnoli polynomial has better error-correcting
    properties than the traditional CRC-32 polynomial, even if we had
    implemented it correctly. Another reason for picking that is that some new
    CPUs have hardware support for calculating CRC-32C, but not CRC-32, let
    alone our strange variant of it. This patch doesn't add any support for such
    hardware, but a future patch could now do that.
    The old algorithm is kept around for tsquery and pg_trgm, which use the
    values in indexes that need to remain compatible so that pg_upgrade works.
    While we're at it, share the old lookup table for CRC-32 calculation
    between hstore, ltree and core. They all use the same table, so might as
Commits on Aug 25, 2014
  1. Andres Freund

    Fix typos in some error messages thrown by extension scripts when fed…

    anarazel authored
    … to psql.
    Some of the many error messages introduced in 458857c missed 'FROM
    unpackaged'. Also e016b72 and 45ffeb7 forgot to quote extension
    version numbers.
    Backpatch to 9.1, just like 458857c which introduced the messages. Do
    so because the error messages thrown when the wrong command is copy &
    pasted aren't easy to understand.
Commits on Jul 14, 2014
  1. Noah Misch

    Add file version information to most installed Windows binaries.

    nmisch authored
    Prominent binaries already had this metadata.  A handful of minor
    binaries, such as pg_regress.exe, still lack it; efforts to eliminate
    such exceptions are welcome.
    Michael Paquier, reviewed by MauMau.
Commits on May 9, 2014
  1. Heikki Linnakangas

    Avoid some pnstrdup()s when constructing jsonb

    hlinnaka authored
    This speeds up text to jsonb parsing and hstore to jsonb conversions
Commits on May 7, 2014
  1. Heikki Linnakangas

    Fix build after removing JsonbValue.estSize field.

    hlinnaka authored
    Oops, I didn't realize that contrib/hstore refers to jsonb stuff.
Commits on May 6, 2014
  1. Bruce Momjian

    pgindent run for 9.4

    bmomjian authored
    This includes removing tabs after periods in C comments, which was
    applied to back branches, so this change should not effect backpatching.
Commits on Apr 18, 2014
  1. Peter Eisentraut

    Create function prototype as part of PG_FUNCTION_INFO_V1 macro

    petere authored
    Because of gcc -Wmissing-prototypes, all functions in dynamically
    loadable modules must have a separate prototype declaration.  This is
    meant to detect global functions that are not declared in header files,
    but in cases where the function is called via dfmgr, this is redundant.
    Besides filling up space with boilerplate, this is a frequent source of
    compiler warnings in extension modules.
    We can fix that by creating the function prototype as part of the
    PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway.  That
    makes the code of modules cleaner, because there is one less place where
    the entry points have to be listed, and creates an additional check that
    functions have the right prototype.
    Remove now redundant prototypes from contrib and other modules.
Commits on Apr 2, 2014
  1. De-anonymize the union in JsonbValue.

    Tom Lane authored
    Needed for strict C89 compliance.
Commits on Mar 23, 2014
  1. Andrew Dunstan

    Introduce jsonb, a structured format for storing json.

    adunstan authored
    The new format accepts exactly the same data as the json type. However, it is
    stored in a format that does not require reparsing the orgiginal text in order
    to process it, making it much more suitable for indexing and other operations.
    Insignificant whitespace is discarded, and the order of object keys is not
    preserved. Neither are duplicate object keys kept - the later value for a given
    key is the only one stored.
    The new type has all the functions and operators that the json type has,
    with the exception of the json generation functions (to_json, json_agg etc.)
    and with identical semantics. In addition, there are operator classes for
    hash and btree indexing, and two classes for GIN indexing, that have no
    equivalent in the json type.
    This feature grew out of previous work by Oleg Bartunov and Teodor Sigaev, which
    was intended to provide similar facilities to a nested hstore type, but which
    in the end proved to have some significant compatibility issues.
    Authors: Oleg Bartunov,  Teodor Sigaev, Peter Geoghegan and Andrew Dunstan.
    Review: Andres Freund
Commits on Feb 21, 2014
  1. Heikki Linnakangas

    Avoid integer overflow in hstore_to_json().

    hlinnaka authored
    The length of the output buffer was calculated based on the size of the
    argument hstore. On a sizeof(int) == 4 platform and a huge argument, it
    could overflow, causing a too small buffer to be allocated.
    Refactor the function to use a StringInfo instead of pre-allocating the
    buffer. Makes it shorter and more readable, too.
Commits on Feb 17, 2014
  1. Noah Misch

    Predict integer overflow to avoid buffer overruns.

    nmisch authored
    Several functions, mostly type input functions, calculated an allocation
    size such that the calculation wrapped to a small positive value when
    arguments implied a sufficiently-large requirement.  Writes past the end
    of the inadvertent small allocation followed shortly thereafter.
    Coverity identified the path_in() vulnerability; code inspection led to
    the rest.  In passing, add check_stack_depth() to prevent stack overflow
    in related functions.
    Back-patch to 8.4 (all supported versions).  The non-comment hstore
    changes touch code that did not exist in 8.4, so that part stops at 9.0.
    Noah Misch and Heikki Linnakangas, reviewed by Tom Lane.
    Security: CVE-2014-0064
Commits on Jan 7, 2014
  1. Peter Eisentraut

    Add more use of psprintf()

    petere authored
Commits on Nov 10, 2013
  1. Peter Eisentraut

    Fix whitespace issues found by git diff --check, add gitattributes

    petere authored
    Set per file type attributes in .gitattributes to fine-tune whitespace
    checks.  With the associated cleanups, the tree is now clean for git
Commits on Oct 17, 2013
  1. Andrew Dunstan

    Return valid json when converting an empty hstore.

    adunstan authored
    Oskari Saarenmaa.
Commits on Sep 30, 2013
  1. Andrew Dunstan

    Add missing condition for pg_depend in hstore migration script.

    adunstan authored
    Error noted by Andres Freund.
  2. Andrew Dunstan
Commits on Sep 29, 2013
  1. Andrew Dunstan

    Use a new hstore extension version for added json functions.

    adunstan authored
    This should have been done when the json functionality was added to
    hstore in 9.3.0. To handle this correctly, the upgrade script therefore
    uses conditional logic by using plpgsql in a DO statement to add the two
    new functions and the new cast. If hstore_to_json_loose is detected as
    already present and dependent on the hstore extension nothing is done.
    This will require that the database be loaded with plpgsql.
    People who have installed the earlier and spurious 1.1 version of hstore
    will need to do:
    to pick up the new functions properly.
Commits on Jul 18, 2013
  1. Fix typo in update scripts for some contrib modules.

    Fujii Masao authored
Commits on Jun 1, 2013
  1. sfrost

    Post-pgindent cleanup

    sfrost authored
    Make slightly better decisions about indentation than what pgindent
    is capable of.  Mostly breaking out long function calls into one
    line per argument, with a few other minor adjustments.
    No functional changes- all whitespace.
    pgindent ran cleanly (didn't change anything) after.
    Passes all regressions.
Commits on May 29, 2013
  1. Bruce Momjian

    pgindent run for release 9.3

    bmomjian authored
    This is the first run of the Perl-based pgindent script.  Also update
    pgindent instructions.
Commits on Apr 19, 2013
  1. Fix typo in comment.

    Robert Haas authored
    Fabrízio de Royes Mello
Commits on Mar 22, 2013
  1. Andrew Dunstan

    Silence compiler warnings about unused values.

    adunstan authored
    Per gripe from Kevin Grittner.
Commits on Mar 14, 2013
  1. Minor fixes for hstore_to_json_loose().

    Tom Lane authored
    Fix unportable use of isdigit(), get rid of useless calculations.
Commits on Mar 10, 2013
  1. Andrew Dunstan

    JSON generation improvements.

    adunstan authored
    This adds the following:
        json_agg(anyrecord) -> json
        to_json(any) -> json
        hstore_to_json(hstore) -> json (also used as a cast)
        hstore_to_json_loose(hstore) -> json
    The last provides heuristic treatment of numbers and booleans.
    Also, in json generation, if any non-builtin type has a cast to json,
    that function is used instead of the type's output function.
    Andrew Dunstan, reviewed by Steve Singer.
    Catalog version bumped.
Commits on Oct 1, 2012
  1. Provide some static-assertion functionality on all compilers.

    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
    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
    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.
Commits on Aug 30, 2012
  1. Alvaro Herrera

    Split tuple struct defs from htup.h to htup_details.h

    alvherre 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.
Commits on Aug 28, 2012
  1. Remove hstore--1.0.sql.

    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.
Commits on Jul 16, 2012
  1. Peter Eisentraut

    Remove unreachable code

    petere 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.
Commits on Jun 24, 2012
  1. Peter Eisentraut

    Replace int2/int4 in C code with int16/int32

    petere 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.
Commits on Apr 24, 2012
  1. Lots of doc corrections.

    Robert Haas authored
    Josh Kupershmidt
Something went wrong with that request. Please try again.