summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2007-02-20Remove the Query structure from the executor's API. This allows us to stopTom Lane
storing mostly-redundant Query trees in prepared statements, portals, etc. To replace Query, a new node type called PlannedStmt is inserted by the planner at the top of a completed plan tree; this carries just the fields of Query that are still needed at runtime. The statement lists kept in portals etc. now consist of intermixed PlannedStmt and bare utility-statement nodes --- no Query. This incidentally allows us to remove some fields from Query and Plan nodes that shouldn't have been there in the first place. Still to do: simplify the execution-time range table; at the moment the range table passed to the executor still contains Query trees for subqueries. initdb forced due to change of stored rules.
2007-02-19Add "isodow" option to EXTRACT() and date_part() where Sunday = 7.Bruce Momjian
2007-02-19Get rid of some old and crufty global variables in the planner. WhenTom Lane
this code was last gone over, there wasn't really any alternative to globals because we didn't have the PlannerInfo struct being passed all through the planner code. Now that we do, we can restructure things to avoid non-reentrancy. I'm fooling with this because otherwise I'd have had to add another global variable for the planned compact range table list.
2007-02-17Remove rint() for to_char MS and US output. We can't us rint() becauseBruce Momjian
we can't overflow to the next higher units, and we might print the lower units for MS.
2007-02-17Cleanup of to_char() patch.Bruce Momjian
Brendan Jurd
2007-02-17Create AVG() aggregates for int8 and NUMERIC which do not compute X^2,Bruce Momjian
as a performance enhancement. Mark Kirkwood
2007-02-16Reduce the amount of memory "clobbered" for every process title change,Bruce Momjian
on platforms that need this. This is done by only writing past the previously stored message, if it was longer.
2007-02-16Better fix for determining minimum and maximum int64 values that doesn'tPeter Eisentraut
require stdint.h and works for "busted" int64.
2007-02-16Code review for SSLKEY patch.Tom Lane
2007-02-16Fix // commentPeter Eisentraut
2007-02-16Add stdint.h includePeter Eisentraut
2007-02-16Functions for mapping table data and table schemas to XML (a.k.a. XML export)Peter Eisentraut
2007-02-16Add two new format fields for use with to_char(), to_date() andBruce Momjian
to_timestamp(): - ID for day-of-week - IDDD for day-of-year This makes it possible to convert ISO week dates to and from text fully represented in either week ('IYYY-IW-ID') or day-of-year ('IYYY-IDDD') format. I have also added an 'isoyear' field for use with extract / date_part. Brendan Jurd
2007-02-16SSL improvements:Bruce Momjian
o read global SSL configuration file o add GUC "ssl_ciphers" to control allowed ciphers o add libpq environment variable PGSSLKEY to control SSL hardware keys Victor B. Wagner
2007-02-15Restructure autovacuum in two processes: a dummy process, which runsAlvaro Herrera
continuously, and requests vacuum runs of "autovacuum workers" to postmaster. The workers do the actual vacuum work. This allows for future improvements, like allowing multiple autovacuum jobs running in parallel. For now, the code keeps the original behavior of having a single autovac process at any time by sleeping until the previous worker has finished.
2007-02-14Fix to_date()/to_timestamp() 'D' field for day of week, was off by one.Bruce Momjian
Converting from char using 'D' doesn't make lots of sense, of course. Report from Brendan Jurd.
2007-02-14Fix capitalization and punctuation of two more GUC description strings.Neil Conway
2007-02-14Fix up foreign-key mechanism so that there is a sound semantic basis for theTom Lane
equality checks it applies, instead of a random dependence on whatever operators might be named "=". The equality operators will now be selected from the opfamily of the unique index that the FK constraint depends on to enforce uniqueness of the referenced columns; therefore they are certain to be consistent with that index's notion of equality. Among other things this should fix the problem noted awhile back that pg_dump may fail for foreign-key constraints on user-defined types when the required operators aren't in the search path. This also means that the former warning condition about "foreign key constraint will require costly sequential scans" is gone: if the comparison condition isn't indexable then we'll reject the constraint entirely. All per past discussions. Along the way, make the RI triggers look into pg_constraint for their information, instead of using pg_trigger.tgargs; and get rid of the always error-prone fixed-size string buffers in ri_triggers.c in favor of building up the RI queries in StringInfo buffers. initdb forced due to columns added to pg_constraint and pg_trigger.
2007-02-13Un-break build on ANSI compilers (like msvc) by moving Assert to positionMagnus Hagander
after variable declarations.
2007-02-13Add comment that to_char() for broken glibc pt_BR might cause a problem.Bruce Momjian
2007-02-11Add support for optionally escaping periods when converting SQL identifiersPeter Eisentraut
to XML names, which will be required for supporting XML export.
2007-02-11Fix for early log messages during postmaster startup getting lost whenMagnus Hagander
running as a service on Win32. Per report from Harald Armin Massa.
2007-02-10Add proper mapping of boolean type data to XML Schema.Peter Eisentraut
2007-02-10StrNCpy -> strlcpy (not complete)Peter Eisentraut
2007-02-09Replace useless uses of := by = in makefiles.Peter Eisentraut
2007-02-09Remove blank lines in code.Bruce Momjian
2007-02-09Combine cmin and cmax fields of HeapTupleHeaders into a single field, byTom Lane
keeping private state in each backend that has inserted and deleted the same tuple during its current top-level transaction. This is sufficient since there is no need to be able to determine the cmin/cmax from any other transaction. This gets us back down to 23-byte headers, removing a penalty paid in 8.0 to support subtransactions. Patch by Heikki Linnakangas, with minor revisions by moi, following a design hashed out awhile back on the pghackers list.
2007-02-09Remove blank line from C code.Bruce Momjian
2007-02-08Fix bug when localized to_char() day or month names were incorectlyBruce Momjian
trnasformed to lower or upper string. Pavel Stehule
2007-02-08Fix bug in our code when using to_timestamp() or to_date() without "TM".Bruce Momjian
Assume "TM" when input fields are variable-length, like month or day names. This matches Oracle behavior.
2007-02-07Add a function pg_stat_clear_snapshot() that discards any statistics snapshotTom Lane
already collected in the current transaction; this allows plpgsql functions to watch for stats updates even though they are confined to a single transaction. Use this instead of the previous kluge involving pg_stat_file() to wait for the stats collector to update in the stats regression test. Internally, decouple storage of stats snapshots from transaction boundaries; they'll now stick around until someone calls pgstat_clear_snapshot --- which xact.c still does at transaction end, to maintain the previous behavior. This makes the logic a lot cleaner, at the price of a couple dozen cycles per transaction exit.
2007-02-07Replace some strncpy() by strlcpy().Peter Eisentraut
2007-02-03Implement XMLSERIALIZE for real. Analogously, make the xml to text castPeter Eisentraut
observe the xmloption. Reorganize the representation of the XML option in the parse tree and the API to make it easier to manage and understand. Add regression tests for parsing back XML expressions.
2007-02-01Wording cleanup for error messages. Also change can't -> cannot.Bruce Momjian
Standard English uses "may", "can", and "might" in different ways: may - permission, "You may borrow my rake." can - ability, "I can lift that log." might - possibility, "It might rain today." Unfortunately, in conversational English, their use is often mixed, as in, "You may use this variable to do X", when in fact, "can" is a better choice. Similarly, "It may crash" is better stated, "It might crash".
2007-01-31Rewrite uuid input and output routines to avoid dependency on theNeil Conway
nonportable "hh" sprintf(3) length modifier. Instead, do the parsing and output by hand. The code to do this isn't ideal, but this is an interim measure anyway: the uuid type should probably use the in-memory struct layout specified by RFC 4122. For now, this patch should hopefully rectify the buildfarm failures for the uuid test. Along the way, re-add pg_cast entries for uuid <-> varchar, which I mistakenly removed earlier, and bump the catversion.
2007-01-31Revert gincostestimate changes.Teodor Sigaev
2007-01-31Allow GIN's extractQuery method to signal that nothing can satisfy the query.Teodor Sigaev
In this case extractQuery should returns -1 as nentries. This changes prototype of extractQuery method to use int32* instead of uint32* for nentries argument. Based on that gincostestimate may see two corner cases: nothing will be found or seqscan should be used. Per proposal at http://archives.postgresql.org/pgsql-hackers/2007-01/msg01581.php PS tsearch_core patch should be sightly modified to support changes, but I'm waiting a verdict about reviewing of tsearch_core patch.
2007-01-30Update documentation for pg_get_serial_sequence() function.Bruce Momjian
2007-01-30Add support for cross-type hashing in hash index searches and hash joins.Tom Lane
Hashing for aggregation purposes still needs work, so it's not time to mark any cross-type operators as hashable for general use, but these cases work if the operators are so marked by hand in the system catalogs.
2007-01-28Rename the uuid_t type to pg_uuid_t, to avoid a conflict with anyNeil Conway
definitions of uuid_t that may be provided by the system headers. This should hopefully fix the Win32 build problems reported by Magnus.
2007-01-28Add a new builtin type, "uuid". This implements a UUID type, similar toNeil Conway
that defined in RFC 4122. This patch includes the basic implementation, plus regression tests. Documentation and perhaps some additional functionality will come later. Catversion bumped. Patch from Gevik Babakhani; review from Peter, Tom, and myself.
2007-01-28Dept of second thoughts: the IQ of estimate_array_length() needs to beTom Lane
kept on par with that of scalararraysel(), else estimates that should track might not. Hence teach it about binary-compatible cases, too.
2007-01-28Fix scalararraysel() to cope with binary-compatible cases, such as text[]Tom Lane
versus varchar[]. This oversight probably explains Ryan Holmes' recent complaint --- he was getting a generic selectivity estimate instead of anything intelligent.
2007-01-27Reactivate libxml memory management via palloc, now that I think I'vePeter Eisentraut
classified the conditions under which this is safe to do (see source code comment).
2007-01-27Add trailing zero byte in Unicode codepoint conversion.Peter Eisentraut
2007-01-25Correction: temp_tablespaces was implemented by Albert Cervera Areny,Bruce Momjian
with cleanup by Jaime Casanova.
2007-01-25Various fixes in the logic of XML functions:Peter Eisentraut
- Add new SQL command SET XML OPTION (also available via regular GUC) to control the DOCUMENT vs. CONTENT option in implicit parsing and serialization operations. - Subtle corrections in the handling of the standalone property in xmlroot(). - Allow xmlroot() to work on content fragments. - Subtle corrections in the handling of the version property in xmlconcat(). - Code refactoring for producing XML declarations.
2007-01-25Add GUC temp_tablespaces to provide a default location for temporaryBruce Momjian
objects. Jaime Casanova
2007-01-25Properly detoast access to bytea field pg_trigger.tgargs. Old codeBruce Momjian
might cause server crash. Backpatch to 8.2.X.
2007-01-25Prevent WAL logging when COPY is done in the same transation thatBruce Momjian
created it. Simon Riggs