summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2003-08-04Remove --enable-recode feature, since it's been broken by IPv6 changes,Tom Lane
and seems to have too few users to justify maintaining.
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-08-04pgindent run.Bruce Momjian
2003-08-01inet_recv() wasn't IPv6-ready.Tom Lane
2003-08-01Fix inconsistent static-vs-not-static declarations.Tom Lane
2003-07-30Add pretty-printing variants of pg_get_viewdef and related functions.Tom Lane
Patch from Andreas Pflug.
2003-07-30Fix numeric_smaller, numeric_larger, float4smaller, float4larger,Tom Lane
float8smaller, float8larger (and thereby the MIN/MAX aggregates on these datatypes) to agree with the datatypes' comparison operations as regards NaN handling. In all these datatypes, NaN is arbitrarily considered larger than any normal value ... but MIN/MAX had not gotten the word. Per recent discussion on pgsql-sql.
2003-07-29Apply (a somewhat revised version of) Greg Mullane's patch to eliminateTom Lane
heuristic determination of day vs month in date/time input. Add the ability to specify that input is interpreted as yy-mm-dd order (which formerly worked, but only for yy greater than 31). DateStyle's input component now has the preferred spellings DMY, MDY, or YMD; the older keywords European and US are now aliases for the first two of these. Per recent discussions on pgsql-general.
2003-07-28A visit from the message-style police ...Tom Lane
2003-07-27Error message editing in utils/adt. Again thanks to Joe Conway for doingTom Lane
the bulk of the heavy lifting ...
2003-07-27This makes the initcap function compatible with Oracle 9i, it has beenBruce Momjian
tested on both redhat 8 and FreebSD. -- Mike Nolan
2003-07-26I corecting date_trunc('quarter',...) and friends because orig versionBruce Momjian
doing '2003-07-30' -> '2003-04-01', '2003-11-30' ->'2003-07-01' B?jthe Zolt?n
2003-07-24Fix timestamp_date for HAVE_INT64_TIMESTAMP case.Tom Lane
2003-07-24Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000.Tom Lane
2003-07-22Error message editing for foreign-key triggers.Tom Lane
2003-07-17Oh, for crying in a bucket ... relax Assert so that glibc's strxfrmTom Lane
does not dump core.
2003-07-17Work around buggy strxfrm() present in some Solaris releases.Tom Lane
2003-07-17Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL conventionTom Lane
for the sign of timezone offsets, ie, positive is east from UTC. These were previously out of step with other operations that accept or show timezones, such as I/O of timestamptz values.
2003-07-14Fix a *second* buffer overrun bug in to_ascii(). Grumble.Tom Lane
2003-07-04tm2timestamp should return -1, not elog, on overflow. (In the backendTom Lane
this is merely an API inconsistency, but in ecpg it's fatal.) Also, fix misconceived overflow test in HAVE_INT64_TIMESTAMP case.
2003-07-04Some early work on error message editing. Operator-not-found andTom Lane
function-not-found messages now distinguish the cases no-match and ambiguous-match, and they follow the style guidelines too.
2003-07-03Fix bug I introduced in recent rewrite of NUMERIC code: numeric toTom Lane
integer conversions gave the wrong answer for values with stripped trailing zeroes, such as 10000000.
2003-07-03Code review for UPDATE tab SET col = DEFAULT patch ... whack it aroundTom Lane
so it has some chance of working in rules ...
2003-07-01SQL functions can have arguments and results declared ANYARRAY orTom Lane
ANYELEMENT. The effect is to postpone typechecking of the function body until runtime. Documentation is still lacking. Original patch by Joe Conway, modified to postpone type checking by Tom Lane.
2003-06-29Support expressions of the form 'scalar op ANY (array)' andTom Lane
'scalar op ALL (array)', where the operator is applied between the lefthand scalar and each element of the array. The operator must yield boolean; the result of the construct is the OR or AND of the per-element results, respectively. Original coding by Joe Conway, after an idea of Peter's. Rewritten by Tom to keep the implementation strictly separate from subqueries.
2003-06-27Fix compile warnings.Tom Lane
2003-06-27First batch of object rename commands.Peter Eisentraut
2003-06-27Create real array comparison functions (that use the element datatype'sTom Lane
comparison functions), replacing the highly bogus bitwise array_eq. Create a btree index opclass for ANYARRAY --- it is now possible to create indexes on array columns. Arrange to cache the results of catalog lookups across multiple array operations, instead of repeating the lookups on every call. Add string_to_array and array_to_string functions. Remove singleton_array, array_accum, array_assign, and array_subscript functions, since these were for proof-of-concept and not intended to become supported functions. Minor adjustments to behavior in some corner cases with empty or zero-dimensional arrays. Joe Conway (with some editorializing by Tom Lane).
2003-06-25Back out array mega-patch.Bruce Momjian
Joe Conway
2003-06-25In ISO datestyle, never emit just HH:MM, always emit HH:MM:SS orTom Lane
HH:MM:SS.SSS... when there is a nonzero part-of-a-day field in an interval value. The seconds part used to be suppressed if zero, but there's no equivalent behavior for timestamp, and since we're modeling this format on timestamp it's probably wrong. Per complaint and patch from Larry Rosenman.
2003-06-25Updated the pg_get_constraintdef() to use conbin. Update pg_dump to useBruce Momjian
pg_get_constraintdef() for >= 70400. Rod Taylor <rbt@rbt.ca>
2003-06-25>> If a transaction marks a tuple for update and later commits withoutBruce Momjian
>> actually having updated the tuple, [...] can we simply >> set the HEAP_XMAX_INVALID hint bit of the tuple? > >AFAICS this is a reasonable thing to do. Thanks for the confirmation. Here's a patch which also contains some more noncritical changes to tqual.c: . make code more readable by introducing local variables for xvac . no longer two separate branches for aborted and crashed. The actions were the same in all cases. Manfred Koizar
2003-06-24Array mega-patch.Bruce Momjian
Joe Conway
2003-06-24Prevent compiler warning from sprintf in recent ipv6 patch.Bruce Momjian
2003-06-24 Add ipv6 address parsing support to 'inet' and 'cidr' data types.Bruce Momjian
Regression tests for IPv6 operations added. Documentation updated to document IPv6 bits. Stop treating IPv4 as an "unsigned int" and IPv6 as an array of characters. Instead, always use the array of characters so we can have one function fits all. This makes bitncmp(), addressOK(), and several other functions "just work" on both address families. add family() function which returns integer 4 or 6 for IPv4 or IPv6. (See examples below) Note that to add this new function you will need to dump/initdb/reload or find the correct magic to add the function to the postgresql function catalogs. IPv4 addresses always sort before IPv6. On disk we use AF_INET for IPv4, and AF_INET+1 for IPv6 addresses. This prevents the need for a dump and reload, but lets IPv6 parsing work on machines without AF_INET6. To select all IPv4 addresses from a table: select * from foo where family(addr) = 4 ... Order by and other bits should all work. Michael Graff
2003-06-22Revise hash join and hash aggregation code to use the same datatype-Tom Lane
specific hash functions used by hash indexes, rather than the old not-datatype-aware ComputeHashFunc routine. This makes it safe to do hash joining on several datatypes that previously couldn't use hashing. The sets of datatypes that are hash indexable and hash joinable are now exactly the same, whereas before each had some that weren't in the other.
2003-06-16Fix bugs in interval-to-time conversion: HAVE_INT64_TIMESTAMP case did notTom Lane
work at all, and neither case behaved sanely for negative intervals.
2003-06-11During looking stuff up for a discussion on -general, I realized thatBruce Momjian
I'd placed the check for newly created matching pk rows for on update no action earlier than it needed to be so that it'd check even when the key values hadn't changed. This patch moves it to after checking for NULLs in the old row and comparing the values since the select's probably more expensive. Stephan Szabo
2003-06-11Represent grant options in the information schema.Peter Eisentraut
2003-06-02Make the world at least marginally safe for usernames with embedded spaces.Tom Lane
Per recent gripe.
2003-05-28Replace functional-index facility with expressional indexes. Any columnTom Lane
of an index can now be a computed expression instead of a simple variable. Restrictions on expressions are the same as for predicates (only immutable functions, no sub-selects). This fixes problems recently introduced with inlining SQL functions, because the inlining transformation is applied to both expression trees so the planner can still match them up. Along the way, improve efficiency of handling index predicates (both predicates and index expressions are now cached by the relcache) and fix 7.3 oversight that didn't record dependencies of predicate expressions.
2003-05-27Make debug_ GUC varables output DEBUG1 rather than LOG, and mention inBruce Momjian
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location. Doc changes included.
2003-05-26Remove comment that cbrt() isn't being used.Bruce Momjian
2003-05-26Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailingTom Lane
blanks, in hopes of reducing the surprise factor for newbies. Remove redundant operators for VARCHAR (it depends wholly on TEXT operations now). Clean up resolution of ambiguous operators/functions to avoid surprising choices for domains: domains are treated as equivalent to their base types and binary-coercibility is no longer considered a preference item when choosing among multiple operators/functions. IsBinaryCoercible now correctly reflects the notion that you need *only* relabel the type to get from type A to type B: that is, a domain is binary-coercible to its base type, but not vice versa. Various marginal cleanup, including merging the essentially duplicate resolution code in parse_func.c and parse_oper.c. Improve opr_sanity regression test to understand about binary compatibility (using pg_cast), and fix a couple of small errors in the catalogs revealed thereby. Restructure "special operator" handling to fetch operators via index opclasses rather than hardwiring assumptions about names (cleans up the pattern_ops stuff a little).
2003-05-25Clean up our static cbrt() implementation in float.c.Bruce Momjian
2003-05-23Improve implementation of btrim/ltrim/rtrim: provide a special case forTom Lane
single-byte encodings, and a direct C implementation of the single-argument forms (where spaces are always what gets trimmed). This is in preparation for using rtrim1() as the bpchar-to-text cast operator, but is a useful performance improvement even if we decide not to do that.
2003-05-20Fix coredump in pg_get_triggerdef, ensure function name is schema-Tom Lane
qualified when necessary, simplify argument-printing code.
2003-05-18Add code to test for unknown timezone names (following some ideas fromTom Lane
Ross Reedstrom, a couple months back) and to detect timezones that are using leap-second timekeeping. The unknown-zone-name test is pretty heuristic and ugly, but it seems better than the old behavior of just switching to GMT given a bad name. Also make DecodePosixTimezone() a tad more robust.
2003-05-15Indexing support for pattern matching operations via separate operatorPeter Eisentraut
class when lc_collate is not C.
2003-05-13More binary I/O routines.Tom Lane