summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2008-05-29Fix some bugs introduced by the 8.2-era conversion of cube functions to V1Tom Lane
calling convention. cube_inter and cube_distance could attempt to pfree their input arguments, and cube_dim returned a value from a struct it might have just pfree'd (which would only really cause a problem in a debug build, but it's still wrong). Per bug #4208 and additional code reading. In HEAD and 8.3, I also made a batch of cosmetic changes to bring these functions into line with the preferred coding style for V1 functions, ie declare and fetch all the arguments at the top so readers can easily see what they are.
2008-05-17Add $PostgreSQL$ markers to a lot of files that were missing them.Andrew Dunstan
This particular batch was just for *.c and *.h file. The changes were made with the following 2 commands: find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *' find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */'
2008-05-16Suppress compiler warning induced by recent header file refactoring.Tom Lane
2008-05-16Update contrib for tsearch changes.Tom Lane
2008-05-12Restructure some header files a bit, in particular heapam.h, by removing someAlvaro Herrera
unnecessary #include lines in it. Also, move some tuple routine prototypes and macros to htup.h, which allows removal of heapam.h inclusion from some .c files. For this to work, a new header file access/sysattr.h needed to be created, initially containing attribute numbers of system columns, for pg_dump usage. While at it, make contrib ltree, intarray and hstore header files more consistent with our header style.
2008-05-09Give a warning if -s switch is used with a non-custom pgbench test.Tom Lane
Also, clean up the code that assigned the scale into :scale variables. Greg Smith and Tom Lane
2008-05-09Fix incorrect archive truncation point calculation in the %r recovery_commandHeikki Linnakangas
parameter. This fixes bug 4137 reported by Wojciech Strzalka, where a WAL file is deleted too early when starting the recovery of a warm standby server. Also add a sanity check in pg_standby so that it will refuse to delete anything earlier than the file being restored, and improve the debug message in case nothing is deleted. Simon Riggs. Backpatch to 8.3, which is where %r was introduced.
2008-05-08Fix contrib/xml2 makefile to not override CFLAGS, and in passing make itTom Lane
auto-configure properly for libxslt present or not.
2008-05-04Use new cstring/text conversion functions in some additional places.Tom Lane
These changes assume that the varchar and xml data types are represented the same as text. (I did not, however, accept the portions of the proposed patch that wanted to assume bytea is the same as text --- tgl.) Brendan Jurd
2008-04-21Make earthdistance use version-0 calling convention if not USE_FLOAT8_BYVAL,Tom Lane
and version-1 if USE_FLOAT8_BYVAL. This might seem a bit pointless, but the idea is to have at least one regression test that will fail if we ever accidentally break version-0 functions that return float8. However, they're already broken, or at least hopelessly unportable, in the USE_FLOAT8_BYVAL case. Per a recent suggestion from Greg Stark.
2008-04-21Allow float8, int8, and related datatypes to be passed by value on machinesTom Lane
where Datum is 8 bytes wide. Since this will break old-style C functions (those still using version 0 calling convention) that have arguments or results of these types, provide a configure option to disable it and retain the old pass-by-reference behavior. Likewise, provide a configure option to disable the recently-committed float4 pass-by-value change. Zoltan Boszormenyi, plus configurability stuff by me.
2008-04-20Convert earthdistance's only C function to v1 call convention,Tom Lane
to future-proof it against pass-by-value float8.
2008-04-19seg_size() has to be V1 calling convention, too.Tom Lane
2008-04-18Change the float4-returning functions in contrib/seg to fmgr v1 callingAlvaro Herrera
conventions. I also changed seg_in and seg_out, which was probably unnecessary, but it can't harm.
2008-04-18Fix typo.Tom Lane
2008-04-18Modify the float4 datatype to be pass-by-val. Along the way, remove the lastAlvaro Herrera
uses of the long-deprecated float32 in contrib/seg; the definitions themselves are still there, but no longer used. fmgr/README updated to match. I added a CREATE FUNCTION to account for existing seg_center() code in seg.c too, and some tests for it and the neighbor functions. At the same time, remove checks for NULL which are not needed (because the functions are declared STRICT). I had to do some adjustments to contrib's btree_gist too. The choices for representation there are not ideal for changing the underlying types :-( Original patch by Zoltan Boszormenyi, with some adjustments by me.
2008-04-14Push index operator lossiness determination down to GIST/GIN opclassTom Lane
"consistent" functions, and remove pg_amop.opreqcheck, as per recent discussion. The main immediate benefit of this is that we no longer need 8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquery searches on GIN indexes. In future it should be possible to optimize some other queries better than is done now, by detecting at runtime whether the index match is exact or not. Tom Lane, after an idea of Heikki's, and with some help from Teodor.
2008-04-11Fix several datatype input functions that were allowing unused bytes in theirTom Lane
results to contain uninitialized, unpredictable values. While this was okay as far as the datatypes themselves were concerned, it's a problem for the parser because occurrences of the "same" literal might not be recognized as equal by datumIsEqual (and hence not by equal()). It seems sufficient to fix this in the input functions since the only critical use of equal() is in the parser's comparisons of ORDER BY and DISTINCT expressions. Per a trouble report from Marc Cousin. Patch all the way back. Interestingly, array_in did not have the bug before 8.2, which may explain why the issue went unnoticed for so long.
2008-04-06Improve hash_any() to use word-wide fetches when hashing suitably alignedTom Lane
data. This makes for a significant speedup at the cost that the results now vary between little-endian and big-endian machines; which forces us to add explicit ORDER BYs in a couple of regression tests to preserve machine-independent comparison results. Also, force initdb by bumping catversion, since the contents of hash indexes will change (at least on big-endian machines). Kenneth Marshall and Tom Lane, based on work from Bob Jenkins. This commit does not adopt Bob's new faster mix() algorithm, however, since we still need to convince ourselves that that doesn't degrade the quality of the hashing.
2008-04-05Make dblink_current_query() reference pg_catalog.current_query(), per Tom.Bruce Momjian
2008-04-05Re-add dblink_current_query() for backward compatibility.Bruce Momjian
2008-04-04Remove unneed #include now that current_query() has moved to the backend.Bruce Momjian
2008-04-04Implement current_query(), that shows the currently executing query.Bruce Momjian
At the same time remove dblink/dblink_current_query() as it is no longer necessary *BACKWARD COMPATIBILITY ISSUE* for dblink Tomas Doran
2008-04-03Add a variant of the Levenshtein string-distance function that lets the userTom Lane
specify the cost values to use, instead of always using 1's. Volkan Yazici In passing, remove fuzzystrmatch.h, which contained a bunch of stuff that had no business being in a .h file; fold it into its only user, fuzzystrmatch.c.
2008-03-26Move the HTSU_Result enum definition into snapshot.h, to avoid includingAlvaro Herrera
tqual.h into heapam.h. This makes all inclusion of tqual.h explicit. I also sorted alphabetically the includes on some source files.
2008-03-26Fix core dump in contrib/xml2's xpath_table() when the input query returnsTom Lane
a NULL value. Per bug #4058.
2008-03-25Simplify and standardize conversions between TEXT datums and ordinary CTom Lane
strings. This patch introduces four support functions cstring_to_text, cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and two macros CStringGetTextDatum and TextDatumGetCString. A number of existing macros that provided variants on these themes were removed. Most of the places that need to make such conversions now require just one function or macro call, in place of the multiple notational layers that used to be needed. There are no longer any direct calls of textout or textin, and we got most of the places that were using handmade conversions via memcpy (there may be a few still lurking, though). This commit doesn't make any serious effort to eliminate transient memory leaks caused by detoasting toasted text objects before they reach text_to_cstring. We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few places where it was easy, but much more could be done. Brendan Jurd and Tom Lane
2008-03-21Adjust pgstatindex() to give correct answers for indexes larger thanTom Lane
2^31 blocks. Also fix pg_relpages() for the same case. Tatsuhito Kasahara
2008-03-19Add -M (query mode) option per ITAGAKI TakahiroTatsuo Ishii
2008-03-19Fix tps calculation when -C supplied. Per Yoshiyuki Asaba.Tatsuo Ishii
Change Copyright owner from mine to PostgreSQL Global Development Group Fix minor message typo
2008-03-12Add a comment explaining one of the ways that pgbench fails to fullyTom Lane
comply with TPC-B. Per Itagaki Takahiro and discussion of bug#3681.
2008-03-10Fix pgbench's getrand() function so that min and max have approximatelyTom Lane
the same chance of being selected as do numbers between them. Problem noted by Greg Stark; fix by Alexey Klyukin.
2008-03-09Change patternsel() so that instead of switching from a pureTom Lane
pattern-examination heuristic method to purely histogram-driven selectivity at histogram size 100, we compute both estimates and use a weighted average. The weight put on the heuristic estimate decreases linearly with histogram size, dropping to zero for 100 or more histogram entries. Likewise in ltreeparentsel(). After a patch by Greg Stark, though I reorganized the logic a bit to give the caller of histogram_selectivity() more control.
2008-02-17Replace time_t with pg_time_t (same values, but always int64) in on-diskTom Lane
data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however.
2008-01-16Remove inappropriate cd commands, per David Wheeler. Also makeTom Lane
the PATH responsive to the installation prefix, which was the apparent intent of the previous edit, but not well executed.
2008-01-14Fix pgstat_heap() to not be broken by syncscans starting from a blockTom Lane
higher than zero. Same problem as just detected in CREATE INDEX CONCURRENTLY.
2008-01-14Use an indexscan not a heapscan to search pg_index in get_pkey_attnames.Tom Lane
Noted while looking for heapscans that might need to start from block zero.
2008-01-03The original patch to disallow non-passworded connections to non-superusersTom Lane
failed to cover all the ways in which a connection can be initiated in dblink. Plug the remaining holes. Also, disallow transient connections in functions for which that feature makes no sense (because they are only sensible as part of a sequence of operations on the same connection). Joe Conway Security: CVE-2007-6601
2008-01-01Fix some missed copyright updates.Tom Lane
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-12-31Add missing return code checks in the uuid-ossp contrib module, per bug #3841.Alvaro Herrera
2007-12-11Make documentation of -W options more accurate and uniform.Tom Lane
2007-12-11Remove the -P options of oid2name and pgbench, as they are securityTom Lane
hazards. Instead teach these programs to prompt for a password when necessary, just like all our other programs. I did not bother to invent -W switches for them, since the return on investment seems so low.
2007-12-11Make vacuumlo prompt for password when needed, thus making its -WTom Lane
switch optional, as is the case for every other one of our programs. I had already documented its -W as being optional, so this is bringing the code into line with the docs ...
2007-12-09Fix completely-bogus volatility markings on pg_trgm functions.Tom Lane
2007-12-07Clean up a couple of problems in crosstab_hash's use of a hash table.Tom Lane
The original coding leaked memory (at least 8K per crosstab_hash call) because it allowed the hash table to be allocated as a child of TopMemoryContext and then never freed it. Fix that by putting the hash table under per_query_ctx, instead. Also get rid of use of a static variable to point to the hash table. Aside from being ugly, that would actively do the wrong thing in the case of re-entrant calls to crosstab_hash, which are at least theoretically possible since it was expecting the static variable to stay valid across a SPI_execute call.
2007-12-04Correct misattribution of earthdistance module --- according to itsTom Lane
old README file, Bruno Wolff did the bulk of the work, but for some reason only Hal Snyder was credited here.
2007-12-03Remove contrib/spi/preprocessor, which has been uninteresting everTom Lane
since we supported standard FOREIGN KEY constraint syntax. It was harmless enough just sitting there, but the prospect of having to document it is surely more work than it's worth.
2007-12-03Remove obsoleted README files.Tom Lane
2007-12-02Remove README files now migrated to SGML docs.Tom Lane