summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2001-09-08Apply 7.1.3 changes to the current tree also.Hiroshi Inoue
2001-09-08Clean up some confusion about where and how to set whereToSendOutput.Tom Lane
We will no longer try to send elog messages to the client before we have initialized backend libpq (oops); however, reporting bogus commandline switches via elog does work now (not irrelevant, because of PGOPTIONS). Fix problem with inappropriate sending of checkpoint-process messages to stderr.
2001-09-07Revise overflow test in int84() to avoid codegen bug in some olderTom Lane
versions of gcc. We don't really need to explicitly test the limits anyway, just reverse-convert and see if we get the same answer.
2001-09-06Commit Karel's patch.Tatsuo Ishii
------------------------------------------------------------------- Subject: Re: [PATCHES] encoding names From: Karel Zak <zakkr@zf.jcu.cz> To: Peter Eisentraut <peter_e@gmx.net> Cc: pgsql-patches <pgsql-patches@postgresql.org> Date: Fri, 31 Aug 2001 17:24:38 +0200 On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote: > > - convert encoding 'name' to 'id' > > I thought we decided not to add functions returning "new" names until we > know exactly what the new names should be, and pending schema Ok, the patch not to add functions. > better > > ...(): encoding name too long Fixed. I found new bug in command/variable.c in parse_client_encoding(), nobody probably never see this error: if (pg_set_client_encoding(encoding)) { elog(ERROR, "Conversion between %s and %s is not supported", value, GetDatabaseEncodingName()); } because pg_set_client_encoding() returns -1 for error and 0 as true. It's fixed too. IMHO it can be apply. Karel PS: * following files are renamed: src/utils/mb/Unicode/KOI8_to_utf8.map --> src/utils/mb/Unicode/koi8r_to_utf8.map src/utils/mb/Unicode/WIN_to_utf8.map --> src/utils/mb/Unicode/win1251_to_utf8.map src/utils/mb/Unicode/utf8_to_KOI8.map --> src/utils/mb/Unicode/utf8_to_koi8r.map src/utils/mb/Unicode/utf8_to_WIN.map --> src/utils/mb/Unicode/utf8_to_win1251.map * new file: src/utils/mb/encname.c * removed file: src/utils/mb/common.c -- Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
2001-09-06 - new to_char(interval, text)Bruce Momjian
- new millisecond (ms) and microsecond (us) support - more robus parsing from string - used is separator checking for non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD') - SGML docs are included Karel Zak
2001-08-27Fix confusion over static-ness of a subroutine.Tom Lane
2001-08-24Rename config.h to pg_config.h and os.h to pg_config_os.h, fix a number ofPeter Eisentraut
places that were including the wrong files.
2001-08-21Remove special-case treatment of all-zeroes MAC address, per today'sTom Lane
discussion in pgsql-general.
2001-08-21Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions inTom Lane
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.
2001-08-14sum() on int2 and int4 columns now uses an int8, not numeric, accumulatorTom Lane
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.
2001-08-13Add comparison operators and btree indexing support for type bytea.Tom Lane
From Joe Conway.
2001-08-12Make ALTER TABLE RENAME on a view rename the view's on-select rule too.Tom Lane
Needed to keep pg_dump from getting confused.
2001-08-09Use format_type sibling in backend error messages, so the user seesPeter Eisentraut
consistent type naming.
2001-07-31Fix optimizer to not try to push WHERE clauses down into a sub-SELECT thatTom Lane
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.
2001-07-16Partial indexes work again, courtesy of Martijn van Oosterhout.Tom Lane
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.
2001-07-15Restructure index AM interface for index building and index tuple deletion,Tom Lane
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.
2001-07-15TODO item:Tatsuo Ishii
* Make n of CHAR(n)/VARCHAR(n) the number of letters, not bytes
2001-07-12Add missing encode file.Bruce Momjian
2001-07-11> > Put encode() into base system. Used part of Alex' patchBruce Momjian
> > for docs, hope he does not mind ;) Marko Kreen
2001-07-10Remove formatter's assumption that year would never exceed four digits.Tom Lane
Enforce MAXTZLEN for all datestyles, not just some. Remove macro definitions that were redundant with datetime.h.
2001-07-10Remove unnecessarily enthusiastic parenthesizing in reverse-listing ofTom Lane
IS NULL, IS TRUE, and friends (my fault...)
2001-07-06Fix my old fault(returns auto variable reference).Hiroshi Inoue
2001-06-25Optimizer can now estimate selectivity of IS NULL, IS NOT NULL,Tom Lane
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.
2001-06-25Suppress gcc warning.Tom Lane
2001-06-22The new files for statistical system views.Jan Wieck
Jan
2001-06-22Statistical system views (yet without the config stuff, butJan Wieck
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
2001-06-19Add IS UNKNOWN, IS NOT UNKNOWN boolean tests, fix the existing booleanTom Lane
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.
2001-06-18Add GUC setting for Australian timezones. Uses new GUC boolean callbackBruce Momjian
functions to clear date cache. Allow regression tests to pass when timezone set.
2001-06-17Make inet/cidr << and <<= operators indexable. From Alex Pilosov ↵Tom Lane
<alex@pilosoft.com>.
2001-06-14has_table_privilege functions from Joe Conway (with some kibitzing fromTom Lane
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.
2001-06-13Attached is a patch adding following functions:Bruce Momjian
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
2001-06-12Back out has_table_privilege patch.Bruce Momjian
2001-06-12OK -- here's take #5.Bruce Momjian
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
2001-06-09Allow GRANT/REVOKE to/from more than one user per invocation. Command tagPeter Eisentraut
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.
2001-06-09Teach convert_to_scalar about datatypes timetz, inet, cidr, macaddr.Tom Lane
2001-06-07This adds unary plus capability. No grammar changes, per Tom's request.Bruce Momjian
Marko Kreen
2001-06-05Correct permissions-checking bugs associated with ancient decision toTom Lane
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.
2001-06-05Further work on making use of new statistics in planner. Adjust APIsTom Lane
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).
2001-06-02Accept and output '-Infinity' as well as 'Infinity', per long-agoTom Lane
suggestion from Ross Reedstrom. Still needs work to make those symbols convert to actual IEEE infinities (on machines where such things exist).
2001-06-02Paranoia about unordered comparisons in IEEE float math. If we areTom Lane
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.
2001-06-01New improved version of bpcharin() may have got the truncation caseTom Lane
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.
2001-05-31RI triggers would fail for datatypes using old-style equal function,Tom Lane
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.
2001-05-28Make text <=> char conversion functions convert zero character to andTom Lane
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.
2001-05-27Fix eqjoinsel() to make use of new statistics.Tom Lane
2001-05-27Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut
privileges. INSERT and COPY FROM now require INSERT (only). Add privileges regression test.
2001-05-22Make bit and bit varying types reject too long input. (They already triedPeter Eisentraut
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.
2001-05-21Make char(n) and varchar(n) types raise an error if the inserted string isPeter Eisentraut
too long. While I was adjusting the regression tests I moved the array things all into array.sql, to make things more manageable.
2001-05-20Modify optimizer data structures so that IndexOptInfo lists built forTom Lane
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!
2001-05-18Undo \dT change. Not worth it.Bruce Momjian
2001-05-18Rename ParseFuncOrColumn() to ParseColumnOrFunc().Bruce Momjian