summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAgeFilesLines
* int8in failed to detect overflow; it really should.Tom Lane2000-02-241-5/+10
|
* Quick hack solution so that pg_dump of views works. Needs repair afterTom Lane2000-02-211-12/+29
| | | | Thomas gets back, but better this than nonfunctional pg_dump in the beta.
* Oops, commited a test version of this file by accident. Revert.Tom Lane2000-02-211-45/+70
|
* Change parse-time representation of float literals (which include oversizeTom Lane2000-02-211-70/+45
| | | | | | | | integers) to be strings instead of 'double'. We convert from string form to internal representation only after type resolution has determined the correct type for the constant. This eliminates loss-of-precision worries and gets rid of the change in behavior seen at 17 digits with the previous kluge.
* Clean up some really grotty coding in catcache.c, improve hashingTom Lane2000-02-211-9/+13
| | | | performance in catcache lookups.
* Create a new expression node type RelabelType, which exists solely toTom Lane2000-02-201-19/+41
| | | | | | | | | | represent the result of a binary-compatible type coercion. At runtime it just evaluates its argument --- but during type resolution, exprType will pick up the output type of the RelabelType node instead of the type of the argument. This solves some longstanding problems with dropped type coercions, an example being 'select now()::abstime::int4' which used to produce date-formatted output, not an integer, because the coercion to int4 was dropped on the floor.
* Implement reindex commandHiroshi Inoue2000-02-181-2/+2
|
* Finish repairing 6.5's problems with r-tree indexes: create appropriateTom Lane2000-02-171-45/+53
| | | | | | | | | | | | selectivity functions and make the r-tree operators use them. The estimation functions themselves are just stubs, unfortunately, but perhaps someday someone will make them compute realistic estimates. Change pg_am so that the optimizer can reliably tell the difference between ordered and unordered indexes --- before it would think that an r-tree index can be scanned in '<<' order, which is not right AFAIK. Repair broken negator links for network_sup and related ops. Initdb forced. This might be my last initdb force for 7.0 ... hope so anyway ...
* All regression tests pass except for rules.sql (unrelated).Thomas G. Lockhart2000-02-162-1490/+2365
| | | | | | | | | | | | | | Implement "date/time grand unification". Transform datetime and timespan into timestamp and interval. Deprecate datetime and timespan, though translate to new types in gram.y. Transform all datetime and timespan catalog entries into new types. Make "INTERVAL" reserved word allowed as a column identifier in gram.y. Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility routines for all date/time types. date.{h,c} now deals with date, time types. timestamp.{h,c} now deals with timestamp, interval types. nabstime.{h,c} now deals with abstime, reltime, tinterval types. Make NUMERIC a known native type for purposes of type coersion. Not tested.
* Implement "date/time grand unification".Thomas G. Lockhart2000-02-165-4415/+3498
| | | | | | | | | | | | | Transform datetime and timespan into timestamp and interval. Deprecate datetime and timespan, though translate to new types in gram.y. Transform all datetime and timespan catalog entries into new types. Make "INTERVAL" reserved word allowed as a column identifier in gram.y. Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility routines for all date/time types. date.{h,c} now deals with date, time types. timestamp.{h,c} now deals with timestamp, interval types. nabstime.{h,c} now deals with abstime, reltime, tinterval types. Make NUMERIC a known native type for purposes of type coersion. Not tested.
* Make eqsel produce better results for boolean columns,Tom Lane2000-02-161-9/+12
| | | | | and make scalarltsel a little more forgiving at the boundaries of the known range of a column value.
* New cost model for planning, incorporating a penalty for random pageTom Lane2000-02-151-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | accesses versus sequential accesses, a (very crude) estimate of the effects of caching on random page accesses, and cost to evaluate WHERE- clause expressions. Export critical parameters for this model as SET variables. Also, create SET variables for the planner's enable flags (enable_seqscan, enable_indexscan, etc) so that these can be controlled more conveniently than via PGOPTIONS. Planner now estimates both startup cost (cost before retrieving first tuple) and total cost of each path, so it can optimize queries with LIMIT on a reasonable basis by interpolating between these costs. Same facility is a win for EXISTS(...) subqueries and some other cases. Redesign pathkey representation to achieve a major speedup in planning (I saw as much as 5X on a 10-way join); also minor changes in planner to reduce memory consumption by recycling discarded Path nodes and not constructing unnecessary lists. Minor cleanups to display more-plausible costs in some cases in EXPLAIN output. Initdb forced by change in interface to index cost estimation functions.
* Repair bogus rule display of attr lists.Tom Lane2000-02-151-6/+10
|
* Carry column aliases from the parser frontend. Enables queries likeThomas G. Lockhart2000-02-151-12/+22
| | | | | | | SELECT a FROM t1 tx (a); Allow join syntax, including queries like SELECT * FROM t1 NATURAL JOIN t2; Update RTE structure to hold column aliases in an Attr structure.
* Recognize special case of POSIX time zone: "GMT+8" and "GMT-8".Thomas G. Lockhart2000-02-151-2/+42
| | | | | | Still needs to be done for the general case: "tz+/-#" where tz is a 3 char string. This will probably involve moving code around to other places.
* Add btree indexing of boolean valuesBruce Momjian2000-02-101-1/+13
| | | | Don Baccus
* I'm sending patch with new version of to_char numbers formatting.Bruce Momjian2000-02-082-435/+739
| | | | | | | | | | | | The PostgreSQL's to_char() is very compatible with Oracle's to_char now. I hope that to_char's 3000 rows of source is without bugs, but will good if anyone test it, for me it works very well :-) Karel ---------------------------------------------------------------------- Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/
* Added complete MATCH <unspecified> support contributed by Don Baccus.Jan Wieck2000-02-071-166/+757
| | | | Jan
* Add include for float.h.Bruce Momjian2000-01-261-2/+2
|
* Add:Bruce Momjian2000-01-2629-58/+87
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* as attache of this mail is patch (to the main tree) with to_char'sBruce Momjian2000-01-252-2/+3159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | family functions. Contain: conversion from a datetype to formatted text: to_char( datetime, text) to_char( timestamp, text) to_char( int4, text) to_char( int8, text) to_char( float4, text) to_char( float8, text) to_char( numeric, text) vice versa: to_date ( text, text) to_datetime ( text, text) to_timestamp ( text, text) to_number ( text, text) (convert to numeric) PostgreSQL to_char is very compatible with Oracle's to_char(), but not total exactly (now). Small differentions are in number formating. It will fix in next to_char() version. ! If will this patch aplly to the main tree, must be delete the current to_char version in contrib (directory "dateformat" and note in contrib's README), this patch not erase it (sorry Bruce). The patch patching files: doc/src/sgml/func.sgml ^^^^^^^^ Hmm, I'm not sure if my English... :( Check it anyone (volunteer)? Thomas, it is right? SGML is not my primary lang and compile the current PG docs tree is very happy job (hard variables setting in docs/sgml/Makefile --> HSTYLE= /home/users/t/thomas/.... :-) What add any definition to global configure.in and set Makefiles in docs tree via ./configure? src/backend/utils/adt/Makefile src/backend/utils/adt/formatting.c src/include/catalog/pg_proc.h src/include/utils/formatting.h Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/
* First cut at making useful selectivity estimates for range queriesTom Lane2000-01-241-64/+110
| | | | | | | | | | | | (ie, WHERE x > lowbound AND x < highbound). It's not very bright yet but it does something useful. Also, rename intltsel/intgtsel to scalarltsel/scalargtsel to reflect usage better. Extend convert_to_scalar to do something a little bit useful with string data types. Still need to make it do something with date/time datatypes, but I'll wait for Thomas's datetime unification dust to settle first. Eventually the routine ought not have any type-specific knowledge at all; it ought to be calling a type-dependent routine found via a pg_type column; but that's a task for another day.
* Remove Ops parameter from STATRELID cache lookup, for Tom Lane andBruce Momjian2000-01-241-2/+2
| | | | optimizer.
* char_length()/octet_length for char() type now returns length ofTatsuo Ishii2000-01-231-4/+4
| | | | the charcter including trailing blanks.
* Replace SearchSysCacheGetAttribute with SysCacheGetAttr, which fetchesTom Lane2000-01-231-29/+19
| | | | | | an attribute of a tuple previously fetched with SearchSysCacheTuple. This avoids a lot of redundant cache lookups, particularly in selfuncs.c. Also, remove SearchSysCacheStruct, which was unused and grotty.
* First cut at unifying regular selectivity estimation with indexscanTom Lane2000-01-231-2/+3
| | | | selectivity estimation wasn't right. This is better...
* Revise handling of index-type-specific indexscan cost estimation, perTom Lane2000-01-221-330/+60
| | | | | | pghackers discussion of 5-Jan-2000. The amopselect and amopnpages estimators are gone, and in their place is a per-AM amcostestimate procedure (linked to from pg_am, not pg_amop).
* added ALTER TABLE DROP COLUMN, early versionPeter Eisentraut2000-01-221-12/+12
|
* Fix bugs in NUMERIC ceil() and floor() functions. ceil(0) returned 1,Tom Lane2000-01-201-3/+3
| | | | | and both would insert random junk digits if given an input that was an exact multiple of 10.
* Removed MBFLAGS from makefiles since it's now done in include/config.h.Peter Eisentraut2000-01-191-5/+1
|
* numeric_in accepts exponents; numeric to int4 rounds; float4/8 to numericTom Lane2000-01-181-480/+259
| | | | | | is considerably more robust and accurate than it used to be. Also, get rid of numeric's private allocation freelist, which is no longer a win since Jan rewrote palloc.
* setheapoverride() is history. Uses replaced with CommandCounterIncrement()Tom Lane2000-01-171-3/+1
| | | | | where necessary --- several of them didn't really need it, though. tqual-checking macros simplified accordingly.
* Clean up problems with rounding/overflow code in NUMERIC, particularlyTom Lane2000-01-151-75/+109
| | | | | the case wherein zero was rejected for a field like NUMERIC(4,4). Miscellaneous other code beautification efforts.
* Fix a passel of problems with incorrect calls to typinput and typoutputTom Lane2000-01-153-12/+14
| | | | | | | functions, which would lead to trouble with datatypes that paid attention to the typelem or typmod parameters to these functions. In particular, incorrect code in pg_aggregate.c explains the platform-specific failures that have been reported in NUMERIC avg().
* Fixed all elog related warnings, as well as a few others.Peter Eisentraut2000-01-1512-95/+96
|
* More cleanups.Bruce Momjian2000-01-111-2/+2
|
* Make number of args to a function configurable.Bruce Momjian2000-01-102-12/+11
|
* Rename oid8 -> oidvector and int28 -> int2vector. Cleanup of *out functions.Bruce Momjian2000-01-104-26/+26
|
* Update int28out and out8out and _in_ functions to handle trailing zerosBruce Momjian2000-01-102-25/+46
| | | | properly.
* Fix oid8in and int28in for spacesBruce Momjian2000-01-102-4/+6
|
* Move fixes for >8 indexed fields.Bruce Momjian2000-01-101-20/+17
|
* Move INDEX_MAX_KEYS to postgres.h, and make it configurable for users.Bruce Momjian2000-01-101-23/+20
|
* Another round of planner/optimizer work. This is just restructuring andTom Lane2000-01-091-7/+14
| | | | | code cleanup; no major improvements yet. However, EXPLAIN does produce more intuitive outputs for nested loops with indexscans now...
* Sorry, that I send this letter/patch again, but previous sending isBruce Momjian2000-01-072-2/+130
| | | | | | | | | still without answer. I want continue with to_char(), but I need any answer for this patch. Please. Thank! (and sorry of my impatient :-) Karel
* Changed "triggered data change violation" detection codeJan Wieck2000-01-061-1/+124
| | | | | | in trigger manager. Jan
* Fixed bug in targetlist expression replacement ofJan Wieck2000-01-061-4/+11
| | | | | | SET DEFAULT referential action triggers. Jan
* Fix it's and its to be correct.Bruce Momjian2000-01-052-6/+6
|
* Repair two recently reported problems:Thomas G. Lockhart2000-01-041-8/+12
| | | | | | | | | | | | | | | | 1) datetime_pl_span() added the seconds field before adding the months field. This lead to erroneous results for e.g. select datetime '1999-11-30' + timespan '1 mon - 1 sec'; Reverse the order of operations to add months first. 2) tm2timespan() did all intermediate math as integer, converting to double at the very end. This resulted in hidden overflows when given very large integer days, hours, etc. For example, select '74565 days'::timespan; produced the wrong result. Change code to ensure that doubles are used for intermediate calculations. Thanks to Olivier PRENANT <ohp@pyrenet.fr> and Tulassay Zsolt <zsolt@tek.bke.hu> for problem reports and to Tom Lane for accurate analyses.
* Update DATEDEBUG removal.Bruce Momjian2000-01-021-8/+3
|
* Remove DATEDEBUG because it didn't look Y2K safe, and fix timestamp elogBruce Momjian2000-01-024-384/+5
| | | | to be Y2K safe.