summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAgeFilesLines
* This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian2001-06-074-6/+57
| | | | Marko Kreen
* Correct permissions-checking bugs associated with ancient decision toTom Lane2001-06-051-20/+15
| | | | | | copy PUBLIC access rights into each newly created ACL entry. Instead treat each ACL entry as independent flags. Also clean up some ugliness in acl.h API.
* Further work on making use of new statistics in planner. Adjust APIsTom Lane2001-06-051-4/+6
| | | | | | | | | of costsize.c routines to pass Query root, so that costsize can figure more things out by itself and not be so dependent on its callers to tell it everything it needs to know. Use selectivity of hash or merge clause to estimate number of tuples processed internally in these joins (this is more useful than it would've been before, since eqjoinsel is somewhat more accurate than before).
* Accept and output '-Infinity' as well as 'Infinity', per long-agoTom Lane2001-06-021-5/+22
| | | | | suggestion from Ross Reedstrom. Still needs work to make those symbols convert to actual IEEE infinities (on machines where such things exist).
* Paranoia about unordered comparisons in IEEE float math. If we areTom Lane2001-06-021-7/+7
| | | | | | given values that compare as unordered, make sure we reply that they are equal, which is better than giving an arbitrary answer --- at least it doesn't depend on which one is passed as which arg.
* New improved version of bpcharin() may have got the truncation caseTom Lane2001-06-011-26/+25
| | | | | | | | | right, but it failed to get the padding case right. This was obscured by subsequent application of bpchar() in all but one regression test case, and that one didn't fail in an obvious way --- trailing blanks are hard to see. Add another test case to make it more obvious if it breaks again.
* RI triggers would fail for datatypes using old-style equal function,Tom Lane2001-05-311-7/+21
| | | | | | because cached fmgr info contained reference to a shorter-lived data structure. Also guard against possibility that fmgr_info could fail, leaving an incomplete entry present in the hash table.
* Make text <=> char conversion functions convert zero character to andTom Lane2001-05-281-5/+33
| | | | | | from an empty text string. This makes them consistent with the de facto behavior of type char's I/O conversion functions, and avoids generating text values with embedded nulls, which confuse many text operators.
* Fix eqjoinsel() to make use of new statistics.Tom Lane2001-05-271-41/+201
|
* Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut2001-05-271-19/+27
| | | | | privileges. INSERT and COPY FROM now require INSERT (only). Add privileges regression test.
* Make bit and bit varying types reject too long input. (They already triedPeter Eisentraut2001-05-222-95/+42
| | | | | | to do that, but inconsistently.) Make bit type reject too short input, too, per SQL. Since it no longer zero pads, 'zpbit*' has been renamed to 'bit*' in the source, hence initdb.
* Make char(n) and varchar(n) types raise an error if the inserted string isPeter Eisentraut2001-05-211-103/+144
| | | | | too long. While I was adjusting the regression tests I moved the array things all into array.sql, to make things more manageable.
* Modify optimizer data structures so that IndexOptInfo lists built forTom Lane2001-05-201-389/+589
| | | | | | | | create_index_paths are not immediately discarded, but are available for subsequent planner work. This allows avoiding redundant syscache lookups in several places. Change interface to operator selectivity estimation procedures to allow faster and more flexible estimation. Initdb forced due to change of pg_proc entries for selectivity functions!
* Undo \dT change. Not worth it.Bruce Momjian2001-05-181-3/+3
|
* Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian2001-05-181-3/+3
|
* First cut at making indexscan cost estimates depend on correlationTom Lane2001-05-091-19/+118
| | | | between index order and table order.
* Fix remaining RI permission problems (cascaded update/delete, restrict,Peter Eisentraut2001-05-071-3/+62
| | | | set null/default).
* Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane2001-05-071-393/+530
| | | | | | | | | | | | | | | | | a separate statement (though it can still be invoked as part of VACUUM, too). pg_statistic redesigned to be more flexible about what statistics are stored. ANALYZE now collects a list of several of the most common values, not just one, plus a histogram (not just the min and max values). Random sampling is used to make the process reasonably fast even on very large tables. The number of values and histogram bins collected is now user-settable via an ALTER TABLE command. There is more still to do; the new stats are not being used everywhere they could be in the planner. But the remaining changes for this project should be localized, and the behavior is already better than before. A not-very-related change is that sorting now makes use of btree comparison routines if it can find one, rather than invoking '<' twice.
* Consolidate several near-identical uses of mktime() into a singleTom Lane2001-05-033-121/+66
| | | | | | | | | routine DetermineLocalTimeZone(). In that routine, be more wary of broken mktime() implementations than the original code was: don't allow mktime to change the already-set y/m/d/h/m/s information, and don't use tm_gmtoff if mktime failed. Possibly this will resolve some of the complaints we've been hearing from users of Middle Eastern timezones on RedHat.
* Ensure that btree sort ordering functions and boolean comparison operatorsTom Lane2001-05-038-520/+403
| | | | | | | | | | give consistent results for all datatypes. Types float4, float8, and numeric were broken for NaN values; abstime, timestamp, and interval were broken for INVALID values; timetz was just plain broken (some possible pairs of values were neither < nor = nor >). Also clean up text, bpchar, varchar, and bit/varbit to eliminate duplicate code and thereby reduce the probability of similar inconsistencies arising in the future.
* Remove bogus Assert from AbsoluteTimeIsBefore(). (If you don't thinkTom Lane2001-04-261-8/+2
| | | | it's bogus, try building a btree index on the regress tests' abstime_tbl.)
* Fix "off by VARHDRSZ" bug in (Cyrillic) recode support.Peter Eisentraut2001-04-191-2/+2
|
* Make rule lister do the right thing with Vars representing whole tuples.Tom Lane2001-04-181-9/+22
|
* Constant expressions that appear in ORDER BY, GROUP BY, DISTINCT ONTom Lane2001-04-151-19/+39
| | | | | | | | lists should be reverse-compiled into targetlist index numbers, because that's the only interpretation the parser allows for a constant in these clauses. (Ergo, the only way they could have gotten into the list in the first place is to have come from the targetlist; so this should always work.) Per problem report from Peter E.
* Another try at making numeric MODULO operator produce the right answer.Tom Lane2001-04-141-6/+18
| | | | | | Although it was now using the right equation, it was making bogus choices of the precision to compute intermediate results to. I'm not sure this is really right even yet, but it's better than before ...
* Correct bogus mktime() calls.Tom Lane2001-04-032-4/+4
|
* Fix comments that were mis-wrapped, for Tom Lane.Bruce Momjian2001-03-232-11/+16
|
* Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian2001-03-226-998/+670
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-2239-1607/+1859
|
* Make regular-expression error messages a tad less obscure,Tom Lane2001-03-191-2/+2
| | | | per gripe from Josh Berkus.
* Remove obsolete PowerPC-specific hack for comparisons to DBL_MINTom Lane2001-03-141-34/+1
| | | | | (per recent discussion with Tatsuo). Hopefully the compilers with that old bug are all long gone.
* Fix numeric modulo operator for case of fractional right argument.Tom Lane2001-03-141-4/+7
|
* Massive commits for SunOS4 port.Tatsuo Ishii2001-02-271-5/+5
|
* Correct bogus output formatting of timeofday() function. A number ofTom Lane2001-02-211-5/+5
| | | | microseconds < 100000 should be displayed as, eg, 13.000126, not 13.126.
* Change case-folding of keywords to conform to SQL99 and fix misbehaviorTom Lane2001-02-211-3/+3
| | | | | | | in Turkish locale. Keywords are now checked under pure ASCII case-folding rules ('A'-'Z'->'a'-'z' and nothing else). However, once a word is determined not to be a keyword, it will be case-folded under the current locale, same as before. See pghackers discussion 20-Feb-01.
* Add some notes about memory management of RI plans.Tom Lane2001-02-151-2/+14
|
* Reduce default selectivity estimates for geometric operators; it seemsTom Lane2001-02-151-5/+5
| | | | | | | the old ones were not small enough to ensure r-tree and gist indexes would get picked when available. These numbers are totally bogus anyway, but in the absence of any real estimation technique, we'd like to select indexes when available ...
* Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane2001-02-141-69/+409
| | | | | | | | | clause with an alias is a <subquery> and therefore hides table references appearing within it, according to the spec. This is the same as the preliminary patch I posted to pgsql-patches yesterday, plus some really grotty code in ruleutils.c to reverse-list a query tree with the correct alias name depending on context. I'd rather not have done that, but unless we want to force another initdb for 7.1, there's no other way for now.
* Please apply the following patch to fix AIX and IRIX timestamp behaviorBruce Momjian2001-02-132-2/+20
| | | | | | | | | | | | | | | as previously discussed. It makes AIX and IRIX not use DST for dates before 1970. The following expected files need to be removed from the regression tests, they contain wrong results and are not needed any more. src/test/regress/expected/horology-1947-PDT.out src/test/regress/expected/tinterval-1947-PDT.out src/test/regress/expected/abstime-1947-PDT.out Zeugswetter Andreas
* poit -> point.Bruce Momjian2001-02-121-2/+2
|
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-102-4/+6
| | | | | | | | | | | are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
* Dump/display 'timestamp' as 'timestamp with time zone', to make room for aPeter Eisentraut2001-02-051-1/+5
| | | | | future 'timestamp without time zone', which SQL claims is equivalent to plain 'timestamp'.
* Change float8-to-int8 conversion to round to nearest, rather thanTom Lane2001-01-261-11/+11
| | | | | | | truncating to integer. Remove regress test that checks whether 4567890123456789 can be converted to float without loss; since that's 52 bits, it's on the hairy edge of failing with IEEE float8s, and indeed rint seems to give platform-dependent results for it.
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-2434-68/+68
|
* Fix all the places that called heap_update() and heap_delete() withoutTom Lane2001-01-231-2/+2
| | | | | | | | | | | bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
* Fix up "Postgres-style" time interval representation when fields haveThomas G. Lockhart2001-01-184-61/+42
| | | | | | | | | | mixed-signs. Previous effort left way too many minus signs, and was at least as broken as the one before that :( Clean up "ISO-style" time interval representation to omit zero fields if there is at least one non-zero field. Supress some leading plus signs when not necessary for clarity. Replace every #ifdef __CYGWIN__ block with a cleaner TIMEZONE_GLOBAL macro defined in datetime.h.
* Change comparisons of tm->tm_isdst from "nonzero" to "greater than zero".Thomas G. Lockhart2001-01-174-55/+60
| | | | | | | | | Not sure why some were this way, and others were already correct, but it seems to have been like this for several years. This caused problems on a few damaged platforms like AIX and IRIX which do not support DST calculations for years before 1970. Thanks to Andreas Zeugswetter <ZeugswetterA@wien.spardat.at> for finding the problem.
* Make aclcontains() do something that's at least vaguely reasonable:Tom Lane2001-01-141-4/+10
| | | | | it now returns true if the aclitem argument exactly matches any one of the elements of the aclitem[] argument. Per complaint from Wolff 1/10/01.
* Fix breakage of rules using NOTIFY actions, per bug report and patchTom Lane2001-01-031-1/+26
| | | | from sergiop@sinectis.com.ar.
* Repair always-broken date_part('quarter',timestamp).Thomas G. Lockhart2001-01-031-5/+5
| | | | | | | Previous result did not have correct month boundaries so anything near edge cases was suspect (e.g. April was in Q1 and July, August were lumped into Q2). Thanks to Denis Osadchy <osadchy@turbo.nsk.su> for the report.