summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAgeFilesLines
* Update this branch to match CVS head, includes WIN32 improvements.Bruce Momjian2003-09-0711-744/+893
|
* Rewrite array_cmp to not depend on deconstruct_array. Should be a littleTom Lane2003-08-151-37/+46
| | | | | faster, but more importantly does not leak memory. Still needs more work though, per my recent note to pgsql-hackers.
* Handle double-quotes correctly in user names in ACL lists.Tom Lane2003-08-141-17/+31
| | | | Christopher Kings-Lynne
* Rewriter and planner should use only resno, not resname, to identifyTom Lane2003-08-111-40/+28
| | | | | | | target columns in INSERT and UPDATE targetlists. Don't rely on resname to be accurate in ruleutils, either. This fixes bug reported by Donald Fraser, in which renaming a column referenced in a rule did not work very well.
* Code cleanup inspired by recent resname bug report (doesn't fix the bugTom Lane2003-08-112-6/+7
| | | | | | | | yet, though). Avoid using nth() to fetch tlist entries; provide a common routine get_tle_by_resno() to search a tlist for a particular resno. This replaces a couple uses of nth() and a dozen hand-coded search loops. Also, replace a few uses of nth(length-1, list) with llast().
* Another pgindent run with updated typedefs.Bruce Momjian2003-08-087-29/+30
|
* Fix floating-point timestamp comparisons to not go nuts if NaN isTom Lane2003-08-082-89/+67
| | | | | | encountered; per bug report from Christian van der Leeden 8/7/03. Also, adjust larger/smaller routines (MAX/MIN) to share code with comparisons for timestamp, interval, timetz.
* Improve documentation of ParseDateTime(). Reorder tests to preventTom Lane2003-08-051-22/+37
| | | | | | writing one more value into return arrays than will fit. This is potentially a stack smash, though I do not think it is a problem in current uses of the routine, since a failure return causes elog anyway.
* Fix several places where fractional-second inputs were misprocessedTom Lane2003-08-051-33/+38
| | | | | | in HAVE_INT64_TIMESTAMP cases, including two potential stack smashes when more than six fractional digits were supplied. Per bug report from Philipp Reisner.
* Fix some copyright notices that weren't updated. Improve copyright toolTom Lane2003-08-047-14/+14
| | | | so it won't miss 'em again.
* Remove --enable-recode feature, since it's been broken by IPv6 changes,Tom Lane2003-08-042-26/+2
| | | | and seems to have too few users to justify maintaining.
* Update copyrights to 2003.Bruce Momjian2003-08-0433-66/+66
|
* pgindent run.Bruce Momjian2003-08-0439-1380/+1534
|
* inet_recv() wasn't IPv6-ready.Tom Lane2003-08-011-13/+10
|
* Fix inconsistent static-vs-not-static declarations.Tom Lane2003-08-011-2/+2
|
* Add pretty-printing variants of pg_get_viewdef and related functions.Tom Lane2003-07-301-183/+870
| | | | Patch from Andreas Pflug.
* Fix numeric_smaller, numeric_larger, float4smaller, float4larger,Tom Lane2003-07-302-57/+31
| | | | | | | | 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.
* Apply (a somewhat revised version of) Greg Mullane's patch to eliminateTom Lane2003-07-291-97/+129
| | | | | | | | | 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.
* A visit from the message-style police ...Tom Lane2003-07-283-13/+13
|
* Error message editing in utils/adt. Again thanks to Joe Conway for doingTom Lane2003-07-2741-900/+1951
| | | | the bulk of the heavy lifting ...
* This makes the initcap function compatible with Oracle 9i, it has beenBruce Momjian2003-07-271-2/+3
| | | | | | tested on both redhat 8 and FreebSD. -- Mike Nolan
* I corecting date_trunc('quarter',...) and friends because orig versionBruce Momjian2003-07-261-5/+5
| | | | | | doing '2003-07-30' -> '2003-04-01', '2003-11-30' ->'2003-07-01' B?jthe Zolt?n
* Fix timestamp_date for HAVE_INT64_TIMESTAMP case.Tom Lane2003-07-241-2/+2
|
* Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000.Tom Lane2003-07-241-8/+8
|
* Error message editing for foreign-key triggers.Tom Lane2003-07-221-284/+212
|
* Oh, for crying in a bucket ... relax Assert so that glibc's strxfrmTom Lane2003-07-171-2/+7
| | | | does not dump core.
* Work around buggy strxfrm() present in some Solaris releases.Tom Lane2003-07-171-15/+16
|
* Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL conventionTom Lane2003-07-173-19/+23
| | | | | | 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.
* Fix a *second* buffer overrun bug in to_ascii(). Grumble.Tom Lane2003-07-141-48/+35
|
* tm2timestamp should return -1, not elog, on overflow. (In the backendTom Lane2003-07-041-5/+10
| | | | | this is merely an API inconsistency, but in ecpg it's fatal.) Also, fix misconceived overflow test in HAVE_INT64_TIMESTAMP case.
* Some early work on error message editing. Operator-not-found andTom Lane2003-07-041-2/+3
| | | | | function-not-found messages now distinguish the cases no-match and ambiguous-match, and they follow the style guidelines too.
* Fix bug I introduced in recent rewrite of NUMERIC code: numeric toTom Lane2003-07-031-3/+12
| | | | | integer conversions gave the wrong answer for values with stripped trailing zeroes, such as 10000000.
* Code review for UPDATE tab SET col = DEFAULT patch ... whack it aroundTom Lane2003-07-031-1/+5
| | | | so it has some chance of working in rules ...
* SQL functions can have arguments and results declared ANYARRAY orTom Lane2003-07-012-5/+5
| | | | | | | | 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.
* Support expressions of the form 'scalar op ANY (array)' andTom Lane2003-06-291-12/+26
| | | | | | | | | | '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.
* Fix compile warnings.Tom Lane2003-06-271-1/+2
|
* First batch of object rename commands.Peter Eisentraut2003-06-271-3/+2
|
* Create real array comparison functions (that use the element datatype'sTom Lane2003-06-274-313/+925
| | | | | | | | | | | | | | | | 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).
* Back out array mega-patch.Bruce Momjian2003-06-254-1034/+286
| | | | Joe Conway
* In ISO datestyle, never emit just HH:MM, always emit HH:MM:SS orTom Lane2003-06-251-6/+4
| | | | | | | | 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.
* Updated the pg_get_constraintdef() to use conbin. Update pg_dump to useBruce Momjian2003-06-251-3/+32
| | | | | | pg_get_constraintdef() for >= 70400. Rod Taylor <rbt@rbt.ca>
* >> If a transaction marks a tuple for update and later commits withoutBruce Momjian2003-06-251-3/+3
| | | | | | | | | | | | | | | >> 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
* Array mega-patch.Bruce Momjian2003-06-244-286/+1034
| | | | Joe Conway
* Prevent compiler warning from sprintf in recent ipv6 patch.Bruce Momjian2003-06-241-3/+3
|
* Add ipv6 address parsing support to 'inet' and 'cidr' data types.Bruce Momjian2003-06-243-286/+824
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revise hash join and hash aggregation code to use the same datatype-Tom Lane2003-06-221-1/+3
| | | | | | | | 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.
* Fix bugs in interval-to-time conversion: HAVE_INT64_TIMESTAMP case did notTom Lane2003-06-161-7/+20
| | | | work at all, and neither case behaved sanely for negative intervals.
* During looking stuff up for a discussion on -general, I realized thatBruce Momjian2003-06-111-12/+13
| | | | | | | | | | 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
* Represent grant options in the information schema.Peter Eisentraut2003-06-111-16/+102
|
* Make the world at least marginally safe for usernames with embedded spaces.Tom Lane2003-06-021-50/+64
| | | | Per recent gripe.