summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* array_agg aggregate function, as per SQL:2008, but without ORDER BY clausePeter Eisentraut2008-11-138-7/+95
| | | | | | | Rearrange the documentation a bit now that array_agg and xmlagg have similar semantics and issues. best of Robert Haas, Jeff Davis, Peter Eisentraut
* PGDLLIMPORT-ize the global variables referenced in pg_crc.h.Tom Lane2008-11-131-5/+5
| | | | I think this will fix current mingw buildfarm failures for pg_trgm.
* Updated parser file to the one generated by the latest version of ↵Michael Meskes2008-11-136-154/+119
| | | | | | parse.[awk|pl] from the latest version of gram.y Some small corrections to test suite.
* Removed two non-terminals:Michael Meskes2008-11-131-13/+7
| | | | | - FloatOnly: only used by NumericOnly, instead put the FloatOnly production into NumericOnly - IntegerOnly: only used by NumericOnly and one ALTER TABLE rule, replacement SignedIconst is already used in several other places
* Fix libpq certificate validation for SSL connections.Magnus Hagander2008-11-133-66/+81
| | | | | | | Add config parameter "sslverify" to control the verification. Default is to do full verification. Clean up some old SSL code that never really worked.
* Arrange to cache the results of looking up a btree predicate proof comparisonTom Lane2008-11-131-47/+197
| | | | | | | | | | | operator. The result depends only on the two input operators and the proof direction (imply or refute), so it's easy to cache. This provides a very large savings in cases such as Sergey Konoplev's long NOT-IN-list example, where predtest spends all its time repeatedly figuring out that the same pair of operators cannot be used to prove anything. (But of course the O(N^2) behavior still catches up with you eventually.) I'm not convinced it buys a whole lot when constraint_exclusion isn't turned on, but it's not a lot of added code so we might as well cache all the time.
* In predtest.c, install a limit on the number of branches we will process inTom Lane2008-11-121-10/+45
| | | | | | | | | | | | | | | | | AND, OR, or equivalent clauses: if there are too many (more than 100) just exit without proving anything. This ensures that we don't spend O(N^2) time trying (and most likely failing) to prove anything about very long IN lists and similar cases. Also, install a couple of CHECK_FOR_INTERRUPTS calls to ensure that a long proof attempt can be interrupted. Per gripe from Sergey Konoplev. Back-patch the whole patch to 8.2 and just the CHECK_FOR_INTERRUPTS addition to 8.1. (The rest of the patch doesn't apply cleanly, and since 8.1 doesn't show the complained-of behavior anyway, it doesn't seem necessary to work hard on it.)
* Update URL to Ross Williams' CRC paper.Alvaro Herrera2008-11-121-2/+2
| | | | Per note from Devrim Gunduz
* Do not use ICONST/SCONST in rules other than Iconst/Sconst.Michael Meskes2008-11-121-8/+8
|
* If we're going to use a SQL function for this, at least make it schema-proof.Tom Lane2008-11-121-2/+2
|
* array_length() function, and for SQL compatibility also cardinality()Peter Eisentraut2008-11-126-5/+97
| | | | | | | | | | function as a special case. This version still has the suspicious behavior of returning null for an empty array (rather than zero), but this may need a wholesale revision of empty array behavior, currently under discussion. Jim Nasby, Robert Haas, Peter Eisentraut
* Fix off-by-one error in autovacuum shmem struct sizing. This could lead toHeikki Linnakangas2008-11-121-2/+2
| | | | | | | autovacuum worker sending SIGUSR1 signal to wrong process, per Zou Yong's report. Backpatch to 8.3.
* Clean up the ancient decision to show only two fractional-seconds digitsTom Lane2008-11-126-1080/+858
| | | | | | | | | | | | | in "postgres_verbose" intervalstyle, and the equally arbitrary decision to show at least two fractional-seconds digits in most other datetime display styles. This results in some minor changes in the expected regression test outputs. Also, coalesce a lot of repetitive code in datetime.c into subroutines, for clarity and ease of maintenance. In particular this roughly halves the number of #ifdef HAVE_INT64_TIMESTAMP segments. Ron Mayer, with some additional kibitzing from Tom Lane
* Ensure that the phrels sets of PlaceHolderVars appearing in an AppendRelInfo'sTom Lane2008-11-111-6/+10
| | | | | | | translated_vars list get updated when pulling up an appendrel member. It's not clear that this really matters at present, since relatively little gets done with the outputs of an appendrel child relation; but it probably will come back to bite us sometime if we leave them with the wrong values.
* Get rid of adjust_appendrel_attr_needed(), which has been broken ever sinceTom Lane2008-11-118-146/+46
| | | | | | | | | | | we extended the appendrel mechanism to support UNION ALL optimization. The reason nobody noticed was that we are not actually using attr_needed data for appendrel children; hence it seems more reasonable to rip it out than fix it. Back-patch to 8.2 because an Assert failure is possible in corner cases. Per examination of an example from Jim Nasby. In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate to represent UNION ALL situations; depend entirely on translated_vars instead.
* Make psql report "SSL connection (unknown cipher)" when libpq has setMagnus Hagander2008-11-111-7/+11
| | | | | | | up a SSL connection, but psql is compiled without support for it. Not a really realistic use-case, but the patch also cuts down on the number of places with #ifdef's...
* Fix sloppy omission of now-required #include's.Tom Lane2008-11-112-2/+4
|
* Change error messages to print the physical path, likeHeikki Linnakangas2008-11-116-214/+134
| | | | | | "base/11517/3767_fsm", instead of symbolic names like "1663/11517/3767/1", per Alvaro's suggestion. I didn't change the messages in the higher-level index, heap and FSM routines, though, where the fork is implicit.
* Replaced manually synced preproc.y by the one created by the new script.Michael Meskes2008-11-1160-4586/+8807
| | | | Adapted regression test files accordingly.
* Add an explicit caution about how to use pg_do_encoding_conversion withTom Lane2008-11-111-1/+7
| | | | non-null-terminated input. Per discussion with ITAGAKI Takahiro.
* Add support for input and output of interval values formatted per ISO 8601;Tom Lane2008-11-119-28/+474
| | | | | | | | specifically, we can input either the "format with designators" or the "alternative format", and we can output the former when IntervalStyle is set to iso_8601. Ron Mayer
* Fix a case of string building.Alvaro Herrera2008-11-102-6/+10
|
* Fix bugs in sqlchar_to_unicode and unicode_to_sqlchar: both were measuringTom Lane2008-11-101-7/+18
| | | | | | the length of a UTF8 character with pg_mblen (wrong if DB encoding isn't UTF8), and the latter was blithely assuming that a static buffer would somehow revert to all zeroes for each use.
* Fix 'Q' format char parsing in the new to_timestamp() code. Used to crash.Heikki Linnakangas2008-11-101-3/+4
|
* Add a --locale switch to createdb, to ease the creation of databases withAlvaro Herrera2008-11-101-2/+26
| | | | | | | | | different locales. This is just syntactical sweetener over --lc-collate and --lc-ctype. Per discussion. While at it, properly document --lc-ctype and --lc-collate in SGML docs, which apparently were forgotten (or purposefully ommited?) when they were created.
* pg_do_encoding_conversion cannot return NULL (at least not unless the inputTom Lane2008-11-103-15/+3
| | | | is NULL), so remove some useless tests for the case.
* Make relhasrules and relhastriggers work like relhasindex, namely we letTom Lane2008-11-106-42/+59
| | | | VACUUM reset them to false rather than trying to clean 'em up during DROP.
* Replace pg_class.reltriggers with relhastriggers, which is just a boolean hintTom Lane2008-11-0912-154/+147
| | | | | | | | | | | | | ("there might be triggers") rather than an exact count. This is necessary catalog infrastructure for the upcoming patch to reduce the strength of locking needed for trigger addition/removal. Split out and committed separately for ease of reviewing/testing. In passing, also get rid of the unused pg_class columns relukeys, relfkeys, and relrefs, which haven't been maintained in many years and now have no chance of ever being maintained (because of wishing to avoid locking). Simon Riggs
* Add a startup check that pg_xlog and pg_xlog/archive_status exist.Tom Lane2008-11-091-1/+56
| | | | | | | If the latter doesn't exist, automatically recreate it. (We don't do this for pg_xlog, though, per discussion.) Jonah Harris
* Add a new GUC variable called "IntervalStyle" that decouples interval outputTom Lane2008-11-0913-55/+320
| | | | | | | | | | from DateStyle, and create a new interval style that produces output matching the SQL standard (at least for interval values that fall within the standard's restrictions). IntervalStyle is also used to resolve the conflict between the standard and traditional Postgres rules for interpreting negative interval input. Ron Mayer
* Fix recently added code for SQL years-months interval syntax so thatTom Lane2008-11-081-2/+2
| | | | | it behaves correctly for a leading minus sign, zero year value, and nonzero month value. Per discussion with Ron Mayer.
* Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at leastTom Lane2008-11-077-12/+415
| | | | | | as much of it as lives in its default tablespace) to a new tablespace. Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane
* Improve bulk-insert performance by keeping the current target buffer pinnedTom Lane2008-11-0612-82/+201
| | | | | | | (but not locked, as that would risk deadlocks). Also, make it work in a small ring of buffers to avoid having bulk inserts trash the whole buffer arena. Robert Haas, after an idea of Simon Riggs'.
* Improve psql's \dC command to take a pattern parameter. Casts are shownTom Lane2008-11-062-8/+34
| | | | | if their source or target types match the pattern (using the same definition of "match" as \dT does). Per recent discussion.
* The logic in systable_beginscan to translate heap attribute numbers toHeikki Linnakangas2008-11-061-17/+27
| | | | | index column numbers needs to handle the case where you have more than one scankey on the same index column. toast_fetch_datum_slice() needs it.
* This maneuver really requires a comment ...Tom Lane2008-11-051-5/+10
|
* change fix for suppress_redundant_updates_trigger() where relation has Oids, ↵Andrew Dunstan2008-11-051-6/+5
| | | | to only apply if present Oid is invalid, per second thought from TGL
* fix suppress_redundant_updates_trigger() where relation has Oids, per gripe ↵Andrew Dunstan2008-11-053-1/+51
| | | | from KaiGai Kohei
* A few additional test cases for array functionalityPeter Eisentraut2008-11-052-2/+75
|
* Rename several aliases for PLpgSQL_datum.dno to also be called dno.Tom Lane2008-11-055-48/+48
| | | | | | Hopefully this will forestall future confusion about their roles. Jonah Harris
* Revert unwanted patch, per Tom.Alvaro Herrera2008-11-041-1/+2
|
* Remove unused rfno from PLpgSQL_recfieldAlvaro Herrera2008-11-041-2/+1
| | | | Jonah Harris
* Fix bug introduced in recent patch to make plpython cope with OUT arguments:Tom Lane2008-11-041-2/+2
| | | | | the proc->argnames array has to be initialized to zero immediately on creation, since the error recovery path will try to free its elements.
* ADD array_ndims functionPeter Eisentraut2008-11-046-5/+35
| | | | Author: Robert Haas <robertmhaas@gmail.com>
* Fix compiler warning about uninitialized variablePeter Eisentraut2008-11-041-2/+2
|
* Disallow LOCK TABLE outside a transaction block (or function), since this caseTom Lane2008-11-043-1/+18
| | | | | almost certainly represents user error. Per a gripe from Sebastian Böhm and subsequent discussion.
* Fix compiler warnings (including a seriously bogus elog call); minorTom Lane2008-11-041-18/+22
| | | | code beautification.
* Use bool for a boolean flag.Tom Lane2008-11-031-6/+7
|
* Allow uuid_in() to parse a wider variety of variant input formats for the UUIDPeter Eisentraut2008-11-031-35/+26
| | | | | | | data type. This patch takes the approach of allowing an optional hyphen after each group of four hex digits. Author: Robert Haas <robertmhaas@gmail.com>
* Dept of second thoughts: seems it'd be safer if pg_typeof is markedTom Lane2008-11-031-2/+2
| | | | stable not immutable, since it depends on system catalog contents.