aboutsummaryrefslogtreecommitdiff
path: root/contrib
Commit message (Collapse)AuthorAge
* Cause initdb to create a third standard database "postgres", whichTom Lane2005-06-21
| | | | | | | | | | | | | | unlike template0 and template1 does not have any special status in terms of backend functionality. However, all external utilities such as createuser and createdb now connect to "postgres" instead of template1, and the documentation is changed to encourage people to use "postgres" instead of template1 as a play area. This should fix some longstanding gotchas involving unexpected propagation of database objects by createdb (when you used template1 without understanding the implications), as well as ameliorating the problem that CREATE DATABASE is unhappy if anyone else is connected to template1. Patch by Dave Page, minor editing by Tom Lane. All per recent pghackers discussions.
* Fix bogus assumption that sizeof() produces an int-sized result.Tom Lane2005-06-20
|
* Simplify uses of readdir() by creating a function ReadDir() thatTom Lane2005-06-19
| | | | | | | includes error checking and an appropriate ereport(ERROR) message. This gets rid of rather tedious and error-prone manipulation of errno, as well as a Windows-specific bug workaround, at more than a dozen call sites. After an idea in a recent patch by Heikki Linnakangas.
* Fix display of database name during autovacuum.Bruce Momjian2005-06-15
| | | | Cosimo Streppone
* Simplify shared-memory lock data structures as per recent discussion:Tom Lane2005-06-14
| | | | | | | | | | | | | | | | it is sufficient to track whether a backend holds a lock or not, and store information about transaction vs. session locks only in the inside-the-backend LocalLockTable. Since there can now be but one PROCLOCK per lock per backend, LockCountMyLocks() is no longer needed, thus eliminating some O(N^2) behavior when a backend holds many locks. Also simplify the LockAcquire/LockRelease API by passing just a 'sessionLock' boolean instead of a transaction ID. The previous API was designed with the idea that per-transaction lock holding would be important for subtransactions, but now that we have subtransactions we know that this is unwanted. While at it, add an 'isTempObject' parameter to LockAcquire to indicate whether the lock is being taken on a temp table. This is not used just yet, but will be needed shortly for two-phase commit.
* Prevent to divide by zero and range out of 0..1Teodor Sigaev2005-06-01
|
* Change relblocknumber field of pg_buffercache view from numeric to int8Tom Lane2005-05-31
| | | | for efficiency's sake. Mark Kirkwood.
* Document get_call_result_type() and friends; mark TypeGetTupleDesc()Tom Lane2005-05-30
| | | | | | and RelationNameGetTupleDesc() as deprecated; remove uses of the latter in the contrib library. Along the way, clean up crosstab() code and documentation a little.
* Improve LockAcquire API per my recent proposal. All error conditionsTom Lane2005-05-29
| | | | | | | | are now reported via elog, eliminating the need to test the result code at most call sites. Make it possible for the caller to distinguish a freshly acquired lock from one already held in the current transaction. Use that capability to avoid redundant AcceptInvalidationMessages() calls in LockRelation().
* Modify hash_search() API to prevent future occurrences of the errorTom Lane2005-05-29
| | | | | | | | | | | | | spotted by Qingqing Zhou. The HASH_ENTER action now automatically fails with elog(ERROR) on out-of-memory --- which incidentally lets us eliminate duplicate error checks in quite a bunch of places. If you really need the old return-NULL-on-out-of-memory behavior, you can ask for HASH_ENTER_NULL. But there is now an Assert in that path checking that you aren't hoping to get that behavior in a palloc-based hash table. Along the way, remove the old HASH_FIND_SAVE/HASH_REMOVE_SAVED actions, which were not being used anywhere anymore, and were surely too ugly and unsafe to want to see revived again.
* Clean up bogus checking of date and numeric fields in DBF files,Tom Lane2005-05-27
| | | | per report from Boris van Schooten.
* Remove second argument from textToQualifiedNameList(), as it is no longerNeil Conway2005-05-27
| | | | used. From Jaime Casanova.
* Add parentheses to macros when args are used in computations. WithoutBruce Momjian2005-05-25
| | | | them, the executation behavior could be unexpected.
* Correct a thinko in pgbench that might result in incorrectly ignoring anNeil Conway2005-05-24
| | | | error condition when executing some DDL. Per report from ITAGAKI Takahiro.
* Cleanup of GiST extensions in contrib/: now that we always invoke GiSTNeil Conway2005-05-21
| | | | | methods in a short-lived memory context, there is no need for GiST methods to do their own manual (and error-prone) memory management.
* Factor out lock cleanup code that is needed in several places in lock.c.Tom Lane2005-05-19
| | | | | | | | Also, remove the rather useless return value of LockReleaseAll. Change response to detection of corruption in the shared lock tables to PANIC, since that is the only way of cleaning up fully. Originally an idea of Heikki Linnakangas, variously hacked on by Alvaro Herrera and Tom Lane.
* Extend the pg_locks system view so that it can fully display all lockTom Lane2005-05-17
| | | | types, as per recent discussion.
* Add a --dbname option to the pg_regress script, and use pl_regressionTom Lane2005-05-17
| | | | | | for testing PLs and contrib_regression for testing contrib, instead of overwriting the core system's regression database as formerly done. Andrew Dunstan
* Cleanup GiST header files. Since GiST extensions are often written asNeil Conway2005-05-17
| | | | | | | | | | | | external projects, we should be careful about what parts of the GiST API are considered implementation details, and which are part of the public API. Therefore, I've moved internal-only declarations into gist_private.h -- future backward-incompatible changes to gist.h should be made with care, to avoid needlessly breaking external GiST extensions. Also did some related header cleanup: remove some unnecessary #includes from gist.h, and remove some unused definitions: isAttByVal(), _gistdump(), and GISTNStrategies.
* Fix typo in comment.Neil Conway2005-05-16
|
* This patch makes some minor style cleanups to contrib/btree_gist: removeNeil Conway2005-05-12
| | | | | the "extern" keyword from function definitions, reorganize some PG_GETARG_XXX() usage, and similar.
* a small tweak to enable display in the log fileBruce Momjian2005-05-11
| | | | | | | of database name before table name when VACUUMing or ANALYZing a table. Cosimo Streppone
* Fix pg_autovacuum -s flag to handle values > 2000 by using sleep()Bruce Momjian2005-05-11
| | | | | | instead of pg_usleep. Backpatch to 8.0.X.
* Tag 1000000L as long for compuation.Bruce Momjian2005-05-11
|
* For some reason access/tupmacs.h has been #including utils/memutils.h,Tom Lane2005-05-06
| | | | | | | which is neither needed by nor related to that header. Remove the bogus inclusion and instead include the header in those C files that actually need it. Also fix unnecessary inclusions and bad inclusion order in tsearch2 files.
* Change tsearch2 to not use the unsafe practice of creating functionsTom Lane2005-05-03
| | | | | | | | that return INTERNAL without also having INTERNAL arguments. Since the functions in question aren't meant to be called by hand anyway, I just redeclared them to take 'internal' instead of 'text'. Also add code to ProcedureCreate() to enforce the restriction, as I should have done to start with :-(
* Fix typos in documentation.Neil Conway2005-05-03
|
* Restructure LOCKTAG as per discussions of a couple months ago.Tom Lane2005-04-29
| | | | | | | | | | | | | | Essentially, we shoehorn in a lockable-object-type field by taking a byte away from the lockmethodid, which can surely fit in one byte instead of two. This allows less artificial definitions of all the other fields of LOCKTAG; we can get rid of the special pg_xactlock pseudo-relation, and also support locks on individual tuples and general database objects (including shared objects). None of those possibilities are actually exploited just yet, however. I removed pg_xactlock from pg_class, but did not force initdb for that change. At this point, relkind 's' (SPECIAL) is unused and could be removed entirely.
* Fix btree_gist to handle timetz zone correctly per recent changes.Tom Lane2005-04-25
|
* Treat a zero-D array as empty in int_enum(), per Andrew@supernews.Tom Lane2005-04-23
|
* int_aggregate's int_enum() doesn't work correctly with arrays thatTom Lane2005-04-23
| | | | | aren't 1-D, so give an error message instead of failing. Per report from Ron Mayer.
* Add comment about permissions on pg_ts* tablesTeodor Sigaev2005-04-19
|
* The following patch should allow UPDATE_INTERVAL to be specified on theBruce Momjian2005-04-19
| | | | | | | | | | | | | | | command line. We find this useful because we frequently deal with thousands of tables in an environment where neither the databases nor the tables are updated frequently. This helps allow us to cut down on the overhead of updating the list for every other primary loop of pg_autovacuum. I chose -i as the command-line argument and documented it briefly in the README. The patch was applied to the 7.4.7 version of pg_autovacuum in contrib. Thomas F.O'Connell
* Completion of project to use fixed OIDs for all system catalogs andTom Lane2005-04-14
| | | | | | | indexes. Replace all heap_openr and index_openr calls by heap_open and index_open. Remove runtime lookups of catalog OID numbers in various places. Remove relcache's support for looking up system catalogs by name. Bulky but mostly very boring patch ...
* Put back code mistakenly removed from copy of postmaster'sTom Lane2005-04-03
| | | | | daemonize routine, namely forcing stdin/stdout/stderr to point to /dev/null. Per Karl Denninger.
* Remove pg_buffercache_pages.h -- patch from Mark Kirkwood.Neil Conway2005-04-01
|
* 1 fix various comparing functionsTeodor Sigaev2005-03-31
| | | | 2 implement gtsvector_out for use with gevel module (debug GiST indexes, http://www.sai.msu.su/~megera/postgres/gist/gevel/)
* Fix build error in pg_buffercache on Win32 (native and cygwin). FromNeil Conway2005-03-31
| | | | Mark Kirkwood.
* Document that the "-P" option to pg_autovacuum is insecure on manyNeil Conway2005-03-30
| | | | platforms, and suggest using ~/.pgpass instead.
* Convert oidvector and int2vector into variable-length arrays. ThisTom Lane2005-03-29
| | | | | | | | | | | | | change saves a great deal of space in pg_proc and its primary index, and it eliminates the former requirement that INDEX_MAX_KEYS and FUNC_MAX_ARGS have the same value. INDEX_MAX_KEYS is still embedded in the on-disk representation (because it affects index tuple header size), but FUNC_MAX_ARGS is not. I believe it would now be possible to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet. There are still a lot of vestigial references to FUNC_MAX_ARGS, which I will clean up in a separate pass. However, getting rid of it altogether would require changing the FunctionCallInfoData struct, and I'm not sure I want to buy into that.
* Have libpgport link before libpq so that PG client applications are moreBruce Momjian2005-03-25
| | | | immunte to changes in libpq's usage of pgport between major versions.
* pgcrypto update:Neil Conway2005-03-21
| | | | | | | | | | * test error handling * add tests for des, 3des, cast5 * add some tests to blowfish, rijndael * Makefile: ability to specify different tests for different crypto libraries, so we can skip des, 3des and cast5 for builtin. Marko Kreen
* pgcrypto update:Neil Conway2005-03-21
| | | | | | | | | | | | | | | Reserve px_get_random_bytes() for strong randomness, add new function px_get_pseudo_random_bytes() for weak randomness and use it in gen_salt(). On openssl case, use RAND_pseudo_bytes() for px_get_pseudo_random_bytes(). Final result is that is user has not configured random souce but kept the 'silly' one, gen_salt() keeps working, but pgp_encrypt() will throw error. Marko Kreen
* pgcrypto update:Neil Conway2005-03-21
| | | | | | | | | | | * openssl.c: Add 3des and AES support * README.pgcrypto: list only supported ciphers for openssl OpenSSL has pre-processor symbol OPENSSL_NO_AES, which isn't that helpful for detecting if it _does_ exist. Thus the hack with AES_ENCRYPT. Marko Kreen
* pgcrypto update:Neil Conway2005-03-21
| | | | | | | | | * Use error codes instead of -1 * px_strerror for new error codes * calling convention change for px_gen_salt - return error code * use px_strerror in pgcrypto.c Marko Kreen
* * construct "struct {} list [] = {}" confuses pgindent - split those.Neil Conway2005-03-21
| | | | | | | | | | It was a bad style to begin with, and now several loops can be clearer. * pgcrypto.c: Fix function comments * crypt-gensalt.c, crypt-blowfish.c: stop messing with errno * openssl.c: use px_free instead pfree * px.h: make redefining px_alloc/px_realloc/px_free easier Marko Kreen
* Remove support for libmhash/libmcrypt.Neil Conway2005-03-21
| | | | | | | | | | | | | | | libmcrypt seems to dead, maintainer address bounces, and cast-128 fails on 2 of the 3 test vectors from RFC2144. So I see no reason to keep around stuff I don't trust anymore. Support for several crypto libraries is probably only confusing to users, although it was good for initial developing - it helped to find hidden assumptions and forced me to create regression tests for all functionality. Marko Kreen
* Adjust the API for aggregate function calls so that a C-coded functionTom Lane2005-03-12
| | | | | | | | | | | | | can tell whether it is being used as an aggregate or not. This allows such a function to avoid re-pallocing a pass-by-reference transition value; normally it would be unsafe for a function to scribble on an input, but in the aggregate case it's safe to reuse the old transition value. Make int8inc() do this. This gets a useful improvement in the speed of COUNT(*), at least on narrow tables (it seems to be swamped by I/O when the table rows are wide). Per a discussion in early December with Neil Conway. I also fixed int_aggregate.c to check this, thereby turning it into something approaching a supportable technique instead of being a crude hack.
* Add pg_buffercache contrib module, from Mark Kirkwood.Neil Conway2005-03-12
|
* Some builds (depends on crypto engine support?) of OpenSSLNeil Conway2005-03-12
| | | | | | | | | | | | 0.9.7x have EVP_DigestFinal function which which clears all of EVP_MD_CTX. This makes pgcrypto crash in functions which re-use one digest context several times: hmac() and crypt() with md5 algorithm. Following patch fixes it by carring the digest info around EVP_DigestFinal and re-initializing cipher. Marko Kreen.