aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAge
* Fix confusion over static-ness of a subroutine.Tom Lane2001-08-27
|
* Rename config.h to pg_config.h and os.h to pg_config_os.h, fix a number ofPeter Eisentraut2001-08-24
| | | | places that were including the wrong files.
* Remove special-case treatment of all-zeroes MAC address, per today'sTom Lane2001-08-21
| | | | discussion in pgsql-general.
* Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions inTom Lane2001-08-21
| | | | | | | | | | | | | | | | | | | | pgsql-hackers. pg_opclass now has a row for each opclass supported by each index AM, not a row for each opclass name. This allows pg_opclass to show directly whether an AM supports an opclass, and furthermore makes it possible to store additional information about an opclass that might be AM-dependent. pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we previously expected the user to remember to provide in CREATE INDEX commands. Lossiness is no longer an index-level property, but is associated with the use of a particular operator in a particular index opclass. Along the way, IndexSupportInitialize now uses the syscaches to retrieve pg_amop and pg_amproc entries. I find this reduces backend launch time by about ten percent, at the cost of a couple more special cases in catcache.c's IndexScanOK. Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane. initdb forced.
* sum() on int2 and int4 columns now uses an int8, not numeric, accumulatorTom Lane2001-08-14
| | | | | | | | | | | | | | | | | | | | for speed reasons; its result type also changes to int8. avg() on these datatypes now accumulates the running sum in int8 for speed; but we still deliver the final result as numeric, so that fractional accuracy is preserved. count() now counts and returns in int8, not int4. I am a little nervous about this possibly breaking users' code, but there didn't seem to be a strong sentiment for avoiding the problem. If we get complaints during beta, we can change count back to int4 and add a "count8" aggregate. For that matter, users can do it for themselves with a simple CREATE AGGREGATE command; the int4inc function is still present, so no C hacking is needed. Also added max() and min() aggregates for OID that do proper unsigned comparison, instead of piggybacking on int4 aggregates. initdb forced.
* Add comparison operators and btree indexing support for type bytea.Tom Lane2001-08-13
| | | | From Joe Conway.
* Make ALTER TABLE RENAME on a view rename the view's on-select rule too.Tom Lane2001-08-12
| | | | Needed to keep pg_dump from getting confused.
* Use format_type sibling in backend error messages, so the user seesPeter Eisentraut2001-08-09
| | | | consistent type naming.
* Fix optimizer to not try to push WHERE clauses down into a sub-SELECT thatTom Lane2001-07-31
| | | | | | has a DISTINCT ON clause, per bug report from Anthony Wood. While at it, improve the DISTINCT-ON-clause recognizer routine to not be fooled by out- of-order DISTINCT lists.
* Partial indexes work again, courtesy of Martijn van Oosterhout.Tom Lane2001-07-16
| | | | | | Note: I didn't force an initdb, figuring that one today was enough. However, there is a new function in pg_proc.h, and pg_dump won't be able to dump partial indexes until you add that function.
* Restructure index AM interface for index building and index tuple deletion,Tom Lane2001-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | per previous discussion on pghackers. Most of the duplicate code in different AMs' ambuild routines has been moved out to a common routine in index.c; this means that all index types now do the right things about inserting recently-dead tuples, etc. (I also removed support for EXTEND INDEX in the ambuild routines, since that's about to go away anyway, and it cluttered the code a lot.) The retail indextuple deletion routines have been replaced by a "bulk delete" routine in which the indexscan is inside the access method. I haven't pushed this change as far as it should go yet, but it should allow considerable simplification of the internal bookkeeping for deletions. Also, add flag columns to pg_am to eliminate various hardcoded tests on AM OIDs, and remove unused pg_am columns. Fix rtree and gist index types to not attempt to store NULLs; before this, gist usually crashed, while rtree managed not to crash but computed wacko bounding boxes for NULL entries (which might have had something to do with the performance problems we've heard about occasionally). Add AtEOXact routines to hash, rtree, and gist, all of which have static state that needs to be reset after an error. We discovered this need long ago for btree, but missed the other guys. Oh, one more thing: concurrent VACUUM is now the default.
* TODO item:Tatsuo Ishii2001-07-15
| | | | * Make n of CHAR(n)/VARCHAR(n) the number of letters, not bytes
* Add missing encode file.Bruce Momjian2001-07-12
|
* > > Put encode() into base system. Used part of Alex' patchBruce Momjian2001-07-11
| | | | | | > > for docs, hope he does not mind ;) Marko Kreen
* Remove formatter's assumption that year would never exceed four digits.Tom Lane2001-07-10
| | | | | Enforce MAXTZLEN for all datestyles, not just some. Remove macro definitions that were redundant with datetime.h.
* Remove unnecessarily enthusiastic parenthesizing in reverse-listing ofTom Lane2001-07-10
| | | | IS NULL, IS TRUE, and friends (my fault...)
* Fix my old fault(returns auto variable reference).Hiroshi Inoue2001-07-06
|
* Optimizer can now estimate selectivity of IS NULL, IS NOT NULL,Tom Lane2001-06-25
| | | | | | | | IS TRUE, etc, with some degree of verisimilitude. Split out selectivity support functions from builtins.h into a new header file selfuncs.h, so as to reduce the number of header files builtins.h must depend on. Fix a few missing inclusions exposed thereby. From Joe Conway, with some kibitzing from Tom Lane.
* Suppress gcc warning.Tom Lane2001-06-25
|
* The new files for statistical system views.Jan Wieck2001-06-22
| | | | Jan
* Statistical system views (yet without the config stuff, butJan Wieck2001-06-22
| | | | | | | it's hard to keep such massive changes in sync with the tree so I need to get it in and work from there now). Jan
* Add IS UNKNOWN, IS NOT UNKNOWN boolean tests, fix the existing booleanTom Lane2001-06-19
| | | | | | | tests to return the correct results per SQL9x when given NULL inputs. Reimplement these tests as well as IS [NOT] NULL to have their own expression node types, instead of depending on special functions. From Joe Conway, with a little help from Tom Lane.
* Add GUC setting for Australian timezones. Uses new GUC boolean callbackBruce Momjian2001-06-18
| | | | | functions to clear date cache. Allow regression tests to pass when timezone set.
* Make inet/cidr << and <<= operators indexable. From Alex Pilosov ↵Tom Lane2001-06-17
| | | | <alex@pilosoft.com>.
* has_table_privilege functions from Joe Conway (with some kibitzing fromTom Lane2001-06-14
| | | | | | Tom Lane). For the moment, only the OID/name variants are provided. I didn't force initdb, but the additions to the 'privileges' regress test won't pass until you do one.
* Attached is a patch adding following functions:Bruce Momjian2001-06-13
| | | | | | | | | inet(text), cidr(text): convert a text value into inet/cidr set_masklen(inet): set masklen on the inet value Patch also contains regression checks for these functions. Alex Pilosov
* Back out has_table_privilege patch.Bruce Momjian2001-06-12
|
* OK -- here's take #5.Bruce Momjian2001-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It "make"s and "make check"s clean against current cvs tip. There are now both Text and Name variants, and the regression test support is rolled into the patch. Note that to be complete wrt Name based variants, there are now 12 user visible versions of has_table_privilege: has_table_privilege(Text usename, Text relname, Text priv_type) has_table_privilege(Text usename, Name relname, Text priv_type) has_table_privilege(Name usename, Text relname, Text priv_type) has_table_privilege(Name usename, Name relname, Text priv_type) has_table_privilege(Text relname, Text priv_type) /* assumes current_user */ has_table_privilege(Name relname, Text priv_type) /* assumes current_user */ has_table_privilege(Text usename, Oid reloid, Text priv_type) has_table_privilege(Name usename, Oid reloid, Text priv_type) has_table_privilege(Oid reloid, Text priv_type) /* assumes current_user */ has_table_privilege(Oid usesysid, Text relname, Text priv_type) has_table_privilege(Oid usesysid, Name relname, Text priv_type) has_table_privilege(Oid usesysid, Oid reloid, Text priv_type) For the Text based inputs, a new internal function, get_Name is used (shamelessly copied from get_seq_name in sequence.c) to downcase if not quoted, or remove quotes if quoted, and truncate. I also added a few test cases for the downcasing, quote removal, and Name based variants to the regression test. Joe Conway
* Allow GRANT/REVOKE to/from more than one user per invocation. Command tagPeter Eisentraut2001-06-09
| | | | | | | | for GRANT/REVOKE is now just that, not "CHANGE". On the way, migrate some of the aclitem internal representation away from the parser and build a real parse tree instead. Also add some 'const' qualifiers.
* Teach convert_to_scalar about datatypes timetz, inet, cidr, macaddr.Tom Lane2001-06-09
|
* This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian2001-06-07
| | | | Marko Kreen
* Correct permissions-checking bugs associated with ancient decision toTom Lane2001-06-05
| | | | | | 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-05
| | | | | | | | | 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-02
| | | | | 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-02
| | | | | | 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-01
| | | | | | | | | 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-31
| | | | | | 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-28
| | | | | | 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-27
|
* Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut2001-05-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-22
| | | | | | 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-21
| | | | | 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-20
| | | | | | | | 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-18
|
* Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian2001-05-18
|
* First cut at making indexscan cost estimates depend on correlationTom Lane2001-05-09
| | | | between index order and table order.
* Fix remaining RI permission problems (cascaded update/delete, restrict,Peter Eisentraut2001-05-07
| | | | set null/default).
* Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane2001-05-07
| | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | 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-03
| | | | | | | | | | 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.