summaryrefslogtreecommitdiff
path: root/src/include/lib
Commit message (Collapse)AuthorAgeFilesLines
* pgindent run for 9.4Bruce Momjian2014-05-062-10/+10
| | | | | This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
* Update copyright for 2014Bruce Momjian2014-01-073-3/+3
| | | | | Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
* Use improved vsnprintf calling logic in more places.Tom Lane2013-10-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | When we are using a C99-compliant vsnprintf implementation (which should be most places, these days) it is worth the trouble to make use of its report of how large the buffer needs to be to succeed. This patch adjusts stringinfo.c and some miscellaneous usages in pg_dump to do that, relying on the logic recently added in libpgcommon's psprintf.c. Since these places want to know the number of bytes written once we succeed, modify the API of pvsnprintf() to report that. There remains near-duplicate logic in pqexpbuffer.c, but since that code is in libpq, psprintf.c's approach of exit()-on-error isn't appropriate for use there. Also note that I didn't bother touching the multitude of places that call (v)snprintf without any attempt to provide a resizable buffer. Release-note-worthy incompatibility: the API of appendStringInfoVA() changed. If there's any third-party code that's calling that directly, it will need tweaking along the same lines as in this patch. David Rowley and Tom Lane
* Reset the binary heap in MergeAppend rescans.Tom Lane2013-08-301-0/+1
| | | | | | | | Failing to do so can cause queries to return wrong data, error out or crash. This requires adding a new binaryheap_reset() method to binaryheap.c, but that probably should have been there anyway. Per bug #8410 from Terje Elde. Diagnosis and patch by Andres Freund.
* Improve ilist.h's support for deletion of slist elements during iteration.Tom Lane2013-07-241-11/+51
| | | | | | | | | | | | | | | | | | Previously one had to use slist_delete(), implying an additional scan of the list, making this infrastructure considerably less efficient than traditional Lists when deletion of element(s) in a long list is needed. Modify the slist_foreach_modify() macro to support deleting the current element in O(1) time, by keeping a "prev" pointer in addition to "cur" and "next". Although this makes iteration with this macro a bit slower, no real harm is done, since in any scenario where you're not going to delete the current list element you might as well just use slist_foreach instead. Improve the comments about when to use each macro. Back-patch to 9.3 so that we'll have consistent semantics in all branches that provide ilist.h. Note this is an ABI break for callers of slist_foreach_modify(). Andres Freund and Tom Lane
* pgindent run for release 9.3Bruce Momjian2013-05-291-3/+3
| | | | | This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
* Update copyrights for 2013Bruce Momjian2013-01-013-3/+3
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Basic binary heap implementation.Robert Haas2012-11-291-0/+53
| | | | | | | | | | There are probably other places where this can be used, but for now, this just makes MergeAppend use it, so that this code will have test coverage. There is other work in the queue that will use this, as well. Abhijit Menon-Sen, reviewed by Andres Freund, Robert Haas, Álvaro Herrera, Tom Lane, and others.
* Add explicit casts in ilist.h's inline functions.Tom Lane2012-11-271-3/+3
| | | | | | Needed to silence C++ errors, per report from Peter Eisentraut. Andres Freund
* Remove unnecessary "head" arguments from some dlist/slist functions.Tom Lane2012-10-181-33/+12
| | | | | | | | dlist_delete, dlist_insert_after, dlist_insert_before, slist_insert_after do not need access to the list header, and indeed insisting on that negates one of the main advantages of a doubly-linked list. In consequence, revert addition of "cache_bucket" field to CatCTup.
* Code review for inline-list patch.Tom Lane2012-10-181-212/+201
| | | | | | | Make foreach macros less syntactically dangerous, and fix some typos in evidently-never-tested ones. Add missing slist_next_node and slist_head_node functions. Fix broken dlist_check code. Assorted comment improvements.
* Embedded list interfaceAlvaro Herrera2012-10-172-85/+767
| | | | | | | | | | | | | | | | | | | Provide a common implementation of embedded singly-linked and doubly-linked lists. "Embedded" in the sense that the nodes' next/previous pointers exist within some larger struct; this design choice reduces memory allocation overhead. Most of the implementation uses inlineable functions (where supported), for performance. Some existing uses of both types of lists have been converted to the new code, for demonstration purposes. Other uses can (and probably will) be converted in the future. Since dllist.c is unused after this conversion, it has been removed. Author: Andres Freund Some tweaks by me Reviewed by Tom Lane, Peter Geoghegan
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-101-1/+2
| | | | commit-fest.
* Update copyright notices for year 2012.Bruce Momjian2012-01-012-2/+2
|
* Add missing format attributesPeter Eisentraut2011-09-101-1/+2
| | | | | | | | | | | Add __attribute__ decorations for printf format checking to the places that were missing them. Fix the resulting warnings. Add -Wmissing-format-attribute to the standard set of warnings for GCC, so these don't happen again. The warning fixes here are relatively harmless. The one serious problem discovered by this was already committed earlier in cf15fb5cabfbc71e07be23cfbc813daee6c5014f.
* Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking ↵Andrew Dunstan2011-04-281-1/+1
| | | | | | | | | printf type functions. The style is set to "printf" for backwards compatibility everywhere except on Windows, where it is set to "gnu_printf", which eliminates hundreds of false error messages from modern versions of gcc arising from %m and %ll{d,u} formats.
* Stamp copyrights for year 2011.Bruce Momjian2011-01-012-2/+2
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-202-2/+2
|
* Update copyright for the year 2010.Bruce Momjian2010-01-022-4/+4
|
* Assorted minor refactoring in EXPLAIN.Tom Lane2009-07-241-1/+7
| | | | | | | | | | This is believed to not change the output at all, with one known exception: "Subquery Scan foo" becomes "Subquery Scan on foo". (We can fix that if anyone complains, but it would be a wart, because the old code was clearly inconsistent.) The main intention is to remove duplicate coding and provide a cleaner base for subsequent EXPLAIN patching. Robert Haas
* Update copyright for 2009.Bruce Momjian2009-01-012-4/+4
|
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-012-4/+4
|
* Add resetStringInfo(), which clears the content of a StringInfo, andNeil Conway2007-03-031-1/+8
| | | | | | fixup various places in the tree that were clearing a StringInfo by hand. Making this function a part of the API simplifies client code slightly, and avoids needlessly peeking inside the StringInfo interface.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-052-4/+4
| | | | back-stamped for this.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-052-4/+4
|
* Standard pgindent run for 8.1.Bruce Momjian2005-10-151-3/+3
|
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-312-4/+4
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Update copyright to 2004.Bruce Momjian2004-08-292-4/+4
|
* Remove an unused (and empty) header file.Neil Conway2004-05-141-17/+0
|
* make sure the $Id tags are converted to $PostgreSQL as well ...PostgreSQL Daemon2003-11-293-3/+3
|
* Update copyrights to 2003.Bruce Momjian2003-08-043-6/+6
|
* pgindent run.Bruce Momjian2003-08-041-3/+4
|
* Infrastructure for upgraded error reporting mechanism. elog.c isTom Lane2003-04-241-4/+20
| | | | | | | rewritten and the protocol is changed, but most elog calls are still elog calls. Also, we need to contemplate mechanisms for controlling all this functionality --- eg, how much stuff should appear in the postmaster log? And what API should libpq expose for it?
* Second round of FE/BE protocol changes. Frontend->backend messages nowTom Lane2003-04-191-1/+11
| | | | have length counts, and COPY IN data is packetized into messages.
* Update copyright to 2002.Bruce Momjian2002-06-203-6/+6
|
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-053-6/+6
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-283-4/+7
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-253-8/+6
| | | | tests pass.
* Further cleanup of dynahash.c API, in pursuit of portability andTom Lane2001-10-051-24/+0
| | | | | | | | | readability. Bizarre '(long *) TRUE' return convention is gone, in favor of just raising an error internally in dynahash.c when we detect hashtable corruption. HashTableWalk is gone, in favor of using hash_seq_search directly, since it had no hope of working with non-LONGALIGNable datatypes. Simplify some other code that was made undesirably grotty by promixity to HashTableWalk.
* Consistently use gcc's __attribute__((format)) to check sprintf-styleTom Lane2001-10-031-2/+4
| | | | | format strings wherever possible. Remarkably, this exercise didn't turn up any inconsistencies, but it seems a good idea for the future.
* pgindent run. Make it all clean.Bruce Momjian2001-03-221-3/+3
|
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-244-8/+8
|
* Clean up non-reentrant interface for hash_seq/HashTableWalk, so thatTom Lane2001-01-021-3/+3
| | | | | | | | starting a new hashtable search no longer clobbers any other search active anywhere in the system. Fix RelationCacheInvalidate() so that it will not crash or go into an infinite loop if invoked recursively, as for example by a second SI Reset message arriving while we are still processing a prior one.
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-161-15/+27
| | | | | | | maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
* First phase of memory management rewrite (see backend/utils/mmgr/READMETom Lane2000-06-281-115/+0
| | | | | | | | | | | | | for details). It doesn't really do that much yet, since there are no short-term memory contexts in the executor, but the infrastructure is in place and long-term contexts are handled reasonably. A few long- standing bugs have been fixed, such as 'VACUUM; anything' in a single query string crashing. Also, out-of-memory is now considered a recoverable ERROR, not FATAL. Eliminate a large amount of crufty, now-dead code in and around memory management. Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and backend startup.
* Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian2000-06-081-2/+1
|
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-122-4/+4
|
* 2. trigger.c fails to compile due to a syntax error. It containsBruce Momjian2000-02-131-2/+2
| | | | | | | | | | | | | | a switch statement that has an empty default label. A label of a switch statement must be followed by a statement (or a label which is followed by a statement (or a label which ...)). 3. Files include stringinfo.h failed to compile. The macro, 'appendStringInfoCharMacro' is implemented with a '?:' operation that returns a void expression for the true part and a char expresion for the false part. Both the true and false parts of the '?:' oper- ator must return the same type. Billy G. Allie
* Fix problems seen in parallel regress tests when SI buffer overruns (causingTom Lane2000-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | syscache and relcache flushes). Relcache entry rebuild now preserves original tupledesc, rewrite rules, and triggers if possible, so that pointers to these things remain valid --- if these things change while relcache entry has positive refcount, we elog(ERROR) to avoid later crash. Arrange for xact-local rels to be rebuilt when an SI inval message is seen for them, so that they are updated by CommandCounterIncrement the same as regular rels. (This is useful because of Hiroshi's recent changes to process our own SI messages at CommandCounterIncrement time.) This allows simplification of some routines that previously hacked around the lack of an automatic update. catcache now keeps its own copy of tupledesc for its relation, rather than depending on the relcache's copy; this avoids needing to reinitialize catcache during a cache flush, which saves some cycles and eliminates nasty circularity problems that occur if a cache flush happens while trying to initialize a catcache. Eliminate a number of permanent memory leaks that used to happen during catcache or relcache flush; not least of which was that catcache never freed any cached tuples! (Rule parsetree storage is still leaked, however; will fix that separately.) Nothing done yet about code that uses tuples retrieved by SearchSysCache for longer than is safe.
* Add:Bruce Momjian2000-01-265-10/+15
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.