aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAge
* Attached are two small patches to expose md5 as a user function -- includingBruce Momjian2002-12-06
| | | | | | | | documentation and regression test mods. It seemed small and unobtrusive enough to not require a specific proposal on the hackers list -- but if not, let me know and I'll make a pitch. Otherwise, if there are no objections please apply. Joe Conway
* More cleanup of userid to be AclId rather than Oid.Bruce Momjian2002-12-05
|
* Make usesysid consistently int4, not oid.Bruce Momjian2002-12-04
| | | | | | Catalog patch from Alvaro Herrera for same. catversion updated. initdb required.
* Tighten selection of equality and ordering operators for groupingTom Lane2002-11-29
| | | | | | | operations: make sure we use operators that are compatible, as determined by a mergejoin link in pg_operator. Also, add code to planner to ensure we don't try to use hashed grouping when the grouping operators aren't marked hashable.
* Repair prehistoric logic error in lseg_eq and lseg_ne.Tom Lane2002-11-29
|
* Use Params, rather than run-time-modified Const nodes, to handleTom Lane2002-11-26
| | | | | | | sublink results and COPY's domain constraint checking. A Const that isn't really constant is just a Bad Idea(tm). Remove hacks in parse_coerce and other places that were needed because of the former klugery.
* Remove unused constisset and constiscast fields of Const nodes. CleanTom Lane2002-11-25
| | | | up code and documentation associated with Param nodes.
* This patch implements FOR EACH STATEMENT triggers, per my email toBruce Momjian2002-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -hackers a couple days ago. Notes/caveats: - added regression tests for the new functionality, all regression tests pass on my machine - added pg_dump support - updated PL/PgSQL to support per-statement triggers; didn't look at the other procedural languages. - there's (even) more code duplication in trigger.c than there was previously. Any suggestions on how to refactor the ExecXXXTriggers() functions to reuse more code would be welcome -- I took a brief look at it, but couldn't see an easy way to do it (there are several subtly-different versions of the code in question) - updated the documentation. I also took the liberty of removing a big chunk of duplicated syntax documentation in the Programmer's Guide on triggers, and moving that information to the CREATE TRIGGER reference page. - I also included some spelling fixes and similar small cleanups I noticed while making the changes. If you'd like me to split those into a separate patch, let me know. Neil Conway
* Fix breakage in new-in-7.3 timetz_zone() function: was giving randomTom Lane2002-11-21
| | | | | | results due to doing arithmetic on uninitialized values. Add some documentation about the AT TIME ZONE construct. Update some other date/time documentation that seemed out of date for 7.3.
* Add an at-least-marginally-plausible method of estimating the numberTom Lane2002-11-19
| | | | | | of groups produced by GROUP BY. This improves the accuracy of planning estimates for grouped subselects, and is needed to check whether a hashed aggregation plan risks memory overflow.
* Reduce need for palloc/pfree overhead in varstr_cmp() by using fixed-sizeTom Lane2002-11-17
| | | | buffers on stack for short strings.
* Add DOMAIN check constraints.Bruce Momjian2002-11-15
| | | | Rod Taylor
* Allow +1300 as a numeric timezone specifier; we already accept FJST as ↵Tom Lane2002-11-13
| | | | meaning +1300.
* Add new palloc0 call as merge of palloc and MemSet(0).Bruce Momjian2002-11-13
|
* Remove NO_MKTIME_BEFORE_1970. I had speculated that it was not neededTom Lane2002-11-12
| | | | | | anymore given the mktime() workaround now done in DetermineLocalTimeZone. This has now been confirmed by Robert Bruccoleri for Irix, and I'm going to extrapolate to AIX as well.
* Back out use of palloc0 in place if palloc/MemSet. Seems constant lenBruce Momjian2002-11-11
| | | | to MemSet is a performance boost.
* Merge palloc()/MemSet(0) calls into a single palloc0() call.Bruce Momjian2002-11-10
|
* This patch removes a bunch of superfluous #include directives: ifBruce Momjian2002-11-08
| | | | | | | | postgres.h or c.h includes a system header (such as stdio.h or stdlib.h), there's no need to specifically include it in any of the .c files in the backend. Neil Conway
* Replace imprecise value of PI with a better one, and tweak circle_polyTom Lane2002-11-08
| | | | | | in hopes of reducing platform-to-platform variations in its results. This will cause the geometry regression test to start failing on some platforms. I plan to update the test later today.
* Add extra_float_digits GUC parameter to allow adjustment of displayedTom Lane2002-11-08
| | | | | | | precision for float4, float8, and geometric types. Set it in pg_dump so that float data can be dumped/reloaded exactly (at least on platforms where the float I/O support is properly implemented). Initial patch by Pedro Ferreira, some additional work by Tom Lane.
* The "Allow easy display of usernames in a group (pg_hba.conf uses groupsBruce Momjian2002-11-08
| | | | | | | | | | | | | | | | now)" item on the open items, and subsequent plpgsql function I sent in, made me realize it was too hard to get the upper and lower bound of an array. The attached creates two functions that I think will be very useful when combined with the ability of plpgsql to return sets. array_lower(array, dim_num) - and - array_upper(array, dim_num) They return the value (as an int) of the upper and lower bound of the requested dim in the provided array. Joe Conway
* Fix range-query estimation to not double-exclude NULLs, per gripe fromTom Lane2002-10-19
| | | | | | | | Ray Ontko 28-June-02. Also, fix prefix_selectivity for NAME lefthand variables (it was bogusly assuming binary compatibility), and adjust make_greater_string() to not call pg_mbcliplen() with invalid multibyte data (this last per bug report that I can't find at the moment, but it was in July '02).
* This patch adds some missing functions for float8 math operations,Bruce Momjian2002-10-19
| | | | | | | | specifically ceil(), floor(), and sign(). There may be other functions that need to be added, but this is a start. I've included some simple regression tests. Neil Conway
* Fix breakage that had crept into setlocale() usage: once again we'veTom Lane2002-10-18
| | | | | | been bit by the fact that the locale functions return pointers to modifiable variables. I added some comments that might help us avoid the mistake in future.
* Make macaddr_in reject trailing garbage (except whitespace).Tom Lane2002-10-13
| | | | Per gripe from Patrick Welche, 13-Oct-2002.
* Fix a couple of grammatical errors in error messages.Tom Lane2002-10-04
|
* Hack to make it possible to load CREATE CONSTRAINT TRIGGER commands thatTom Lane2002-10-03
| | | | | are missing the FROM clause (due to a long-ago pg_dump bug). Patch by Stephan Szabo, minor tweaking by Tom Lane.
* Alter scale selection for NUMERIC division and transcendental functionsTom Lane2002-10-02
| | | | | | so that precision of result is always at least as good as you'd get from float8 arithmetic (ie, always at least 16 digits of accuracy). Per pg_hackers discussion a few days ago.
* Change default privileges for languages and functions to be PUBLIC USAGETom Lane2002-09-24
| | | | | and PUBLIC EXECUTE, respectively. Per discussion about easing updates from prior versions.
* Bring SIMILAR TO and SUBSTRING into some semblance of conformance withTom Lane2002-09-22
| | | | | | | the SQL99 standard. (I'm not sure that the character-class features are quite right, but that can be fixed later.) Document SQL99 and POSIX regexps as being different features; provide variants of SUBSTRING for each.
* Add last-ditch defense against attempts to compile datetime code withTom Lane2002-09-21
| | | | -ffast-math.
* The patch fix bug described in TODO:Bruce Momjian2002-09-20
| | | | | | * to_char(0,'FM999.99') returns a period, to_char(1,'FM999.99') does not Karel Zak
* Tom Lane wrote:Bruce Momjian2002-09-20
| | | | | | | | | | | | | | | > I see in your recent bytea-LIKE patch > > if (datatype != BYTEAOID && pg_database_encoding_max_length() > 1) > len = pg_mbcliplen((const unsigned char *) workstr, len, len - 1); > else > len -= -1; > > Surely there's one too many minus signs in that last? Joe Conway
* This patch cleans up some of the code in src/util/adt/formatting.c,Bruce Momjian2002-09-20
| | | | | | | fixes a few minor bugs (typos, potential buffer overruns, etc.), and fixes some spelling/grammar mistakes. Neil Conway
* Tweak heap.c to refuse attempts to create table columns of standaloneTom Lane2002-09-19
| | | | | | composite types. Add a couple more lsyscache.c routines to support this, and make use of them in some other places that were doing lookups the hard way.
* Department of second thoughts: suppressing implicit casts everywhere inTom Lane2002-09-19
| | | | | | | | ruleutils display is not such a great idea. For arguments of functions and operators I think we'd better keep the historical behavior of showing such casts explicitly, to ensure that the function/operator is reparsed the same way when the rule is reloaded. This also makes the output of EXPLAIN less obscurantist about exactly what's happening.
* Extend pg_cast castimplicit column to a three-way value; this allows usTom Lane2002-09-18
| | | | | | | | | | | | | | | | | | | | | | | | to be flexible about assignment casts without introducing ambiguity in operator/function resolution. Introduce a well-defined promotion hierarchy for numeric datatypes (int2->int4->int8->numeric->float4->float8). Change make_const to initially label numeric literals as int4, int8, or numeric (never float8 anymore). Explicitly mark Func and RelabelType nodes to indicate whether they came from a function call, explicit cast, or implicit cast; use this to do reverse-listing more accurately and without so many heuristics. Explicit casts to char, varchar, bit, varbit will truncate or pad without raising an error (the pre-7.2 behavior), while assigning to a column without any explicit cast will still raise an error for wrong-length data like 7.3. This more nearly follows the SQL spec than 7.2 behavior (we should be reporting a 'completion condition' in the explicit-cast cases, but we have no mechanism for that, so just do silent truncation). Fix some problems with enforcement of typmod for array elements; it didn't work at all in 'UPDATE ... SET array[n] = foo', for example. Provide a generalized array_length_coerce() function to replace the specialized per-array-type functions that used to be needed (and were missing for NUMERIC as well as all the datetime types). Add missing conversions int8<->float4, text<->numeric, oid<->int8. initdb forced.
* Be careful to include postgres.h *before* any system headers, to ensureTom Lane2002-09-05
| | | | | | that the right flavors of largefile-related definitions are seen. Most of these changes are probably unnecessary, but better safe than sorry.
* pgindent run.Bruce Momjian2002-09-04
|
* EXTRACT(EPOCH FROM timestamp) gave wrong answers in the int64-timestampTom Lane2002-09-03
| | | | | case for timestamptz input, and differently wrong answers in the float- timestamp case for timestamp input.
* Arrange for the default permissions on a database to allow temp tableTom Lane2002-09-03
| | | | | | | creation to world, but disallow temp table creation in template1. Per latest round of pghackers discussion. I did not force initdb, but the permissions lockdown on template1 will not take effect unless you do one (or manually REVOKE TEMP ON DATABASE template1 FROM public).
* Remove all traces of multibyte and locale options. Clean up commentsPeter Eisentraut2002-09-03
| | | | referring to "multibyte" where it really means character encoding.
* Work around mktime() brain damage in recent versions of glibc by usingTom Lane2002-09-03
| | | | | | | a series of localtime() calls to determine the local timezone offset when mktime() fails. This eliminates regression failures on RHL 7.3, and should continue to work until it occurs to the glibc boys to break localtime() as well. By then I hope we'll have our own timezone code...
* Eliminate unnecessary dependency on mktime(), and consequent 'Unable toTom Lane2002-09-03
| | | | convert date to tm' failures, by using DetermineLocalTimeZone() instead.
* > Okay. When you get back to the original issue, the gold is hidden inBruce Momjian2002-09-02
| | | | | | | | | | | | > src/backend/optimizer/path/indxpath.c; see the "special indexable > operators" stuff near the bottom of that file. (It's a bit of a crock > that this code is hardwired there, and not somehow accessed through a > system catalog, but it's what we've got at the moment.) The attached patch re-enables a bytea right hand argument (as compared to a text right hand argument), and enables index usage, for bytea LIKE Joe Conway
* I checked all the previous string handling errors and most of them wereBruce Momjian2002-09-02
| | | | | | | | | | | | | | | already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa
* Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian2002-09-02
| | | | because c.h has sys/types.h.
* Code review for HeapTupleHeader changes. Add version number to page headersTom Lane2002-09-02
| | | | | | | | | | (overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask, per earlier discussion. Simplify scheme for overlaying fields in tuple header (no need for cmax to live in more than one place). Don't try to clear infomask status bits in tqual.c --- not safe to do it there. Don't try to force output table of a SELECT INTO to have OIDs, either. Get rid of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which has already caused one recent failure. Improve documentation.
* Mark the float8 -> int8 cast as implicit. This resolves the problemTom Lane2002-09-01
| | | | | | | | | | pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails because the constant is initially taken as float8. We really need a better way, but it's not gonna happen for 7.3. Also, remove int4reltime() function, which is redundant with the existing binary-compatibility coercion path from int4 to reltime, and probably has been unreachable code for a long while.
* Code review for domain-constraints patch. Use a new ConstraintTest nodeTom Lane2002-08-31
| | | | | | | | | type for runtime constraint checks, instead of misusing the parse-time Constraint node for the purpose. Fix some damage introduced into type coercion logic; in particular ensure that a coerced expression tree will read out the correct result type when inspected (patch had broken some RelabelType cases). Enforce domain NOT NULL constraints against columns that are omitted from an INSERT.