aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAge
* Change float8-to-int8 conversion to round to nearest, rather thanTom Lane2001-01-26
| | | | | | | 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-24
|
* Fix all the places that called heap_update() and heap_delete() withoutTom Lane2001-01-23
| | | | | | | | | | | 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-18
| | | | | | | | | | 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-17
| | | | | | | | | 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-14
| | | | | 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-03
| | | | from sergiop@sinectis.com.ar.
* Repair always-broken date_part('quarter',timestamp).Thomas G. Lockhart2001-01-03
| | | | | | | 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.
* Let's try this again on accepting the correct range of Oid input valuesTom Lane2000-12-28
| | | | for 64-bit platforms ...
* Fix portability problems recently exposed by regression tests on Alphas.Tom Lane2000-12-27
| | | | | | | | | | 1. Distinguish cases where a Datum representing a tuple datatype is an OID from cases where it is a pointer to TupleTableSlot, and make sure we use the right typlen in each case. 2. Make fetchatt() and related code support 8-byte by-value datatypes on machines where Datum is 8 bytes. Centralize knowledge of the available by-value datatype sizes in two macros in tupmacs.h, so that this will be easier if we ever have to do it again.
* Replace overly-cute coding with code that (a) has defined behaviorTom Lane2000-12-23
| | | | | according to the ANSI C spec, (b) gets the boundary conditions right, and (c) is about a third as long and three times more intelligible.
* Repair not-too-well-thought-out code to do rangechecking of OIDs onTom Lane2000-12-22
| | | | 64-bit machines. Also, make oidvectorin use the same code as oidin.
* Add 'ONLY' to queries generated by RI triggers, so as to preserve pre-7.1Tom Lane2000-12-22
| | | | | semantics of RI operations. Eventually we ought to look at making RI work properly across inheritance trees, but not for 7.1 ...
* Change default output formatting for CIDR to be unabbreviated, perTom Lane2000-12-22
| | | | | | recommendation from Paul Vixie. Add a new abbrev() function to produce abbreviated format as text. No forced initdb, but new function is not available unless you do an initdb or add the pg_proc row manually.
* here is a patch fixing today's bug report:Bruce Momjian2000-12-15
| | | | | | | | | | | | | | | | | | | | > Date: Thu, 14 Dec 2000 12:44:47 +0100 (CET) > From: Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu> > To: pgsql-bugs@postgresql.org > Subject: [BUGS] to_char() causes backend to close connection > > Hi, this query gives different strange results: > > select to_char(now()::abstime,'YYMMDDHH24MI'); > > I get e.g. a "backend closed the channel unexpectedly..." error with > successful or failed resetting attempt (indeterministic) Again thanks Kovacs, you found really designing bug, that appear if anyone write bad format template to "number" version of to_char() (as you with 'DD'). Karel
* Fix ILIKE bug (only in multi-byte case)Tatsuo Ishii2000-12-11
|
* Portability fix from Ryan Kirkpatrick's Alpha patches. I believe thisTom Lane2000-12-09
| | | | is the only diff not accounted for by fmgr rewrite...
* Repair erroneous use of hashvarlena() for MACADDR, which is not aTom Lane2000-12-08
| | | | | | | varlena type. (I did not force initdb, but you won't see the fix unless you do one.) Also, make sure all index support operators and functions are careful not to leak memory for toasted inputs; I had missed some hash and rtree support ops on this point before.
* Change lpad() and rpad() to behave more Oracle-compatibly when targetTom Lane2000-12-07
| | | | length is less than original string length.
* Make OVERLAPS operators conform to SQL92 spec regarding NULL handling.Tom Lane2000-12-07
| | | | | | | | | | As I read it, the spec requires a non-null result in some cases where one of the inputs is NULL: specifically, if the other endpoint of that interval is between the endpoints of the other interval, then the result is known TRUE despite the missing endpoint. The spec could've been a lot simpler if they did not intend this behavior. I did not force an initdb for this change, but if you don't do one you'll still see the old strict-function behavior.
* Silence compiler warning.Tom Lane2000-12-07
|
* Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane2000-12-03
| | | | | values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
* Repair usage of the OVERLAPS operator.Thomas G. Lockhart2000-12-03
| | | | | | | | Allow some operator-like tokens to be used as function names. Flesh out support for time, timetz, and interval operators and interactions. Regression tests pass, but non-reference-platform horology test results will need to be updated.
* It seems appropriate that the extended MEMORY_CONTEXT_CHECKING codeTom Lane2000-12-01
| | | | | immediately uncovered three of Karel's own bugs, including a routine that scribbled on its input (naughty naughty!)
* aclitemout() shouldn't coredump when it finds an ACL itemTom Lane2000-11-28
| | | | | for a now-vanished group. Instead, display the numeric group ID, same as it does for vanished users.
* Fix for inserting/copying longer multibyte strings into bpchar dataTatsuo Ishii2000-11-26
| | | | types.
* Make PGLC_setlocale() static, and document that it can't be used safelyTom Lane2000-11-25
| | | | | | | | | | | for any other purpose than PGLC_localeconv()'s internal save/restore of locale settings. Fix cash.c to call PGLC_localeconv() rather than making a direct call to localeconv() --- the old way, if PGLC_localeconv() had already cached a locale result, it would be overwritten by the first cash_in or cash_out operation, leading to wrong-locale results later. Probably no demonstrable bug today, since we only appear to be looking at the LC_MONETARY results which should be the same anyway, but definitely a gotcha waiting to strike.
* Fix some portability bugs I'd introduced into inet/cidr code ---Tom Lane2000-11-25
| | | | shifting by the word width is not defined by ANSI C...
* Store current LC_COLLATE and LC_CTYPE settings in pg_control during initdb;Tom Lane2000-11-25
| | | | | | | | | | re-adopt these settings at every postmaster or standalone-backend startup. This should fix problems with indexes becoming corrupt due to failure to provide consistent locale environment for postmaster at all times. Also, refuse to start up a non-locale-enabled compilation in a database originally initdb'd with a non-C locale. Suppress LIKE index optimization if locale is not "C" or "POSIX" (are there any other locales where it's safe?). Issue NOTICE during initdb if selected locale disables LIKE optimization.
* here is a patch for formatting.c (to_char/timestampt()), for 7.1Bruce Momjian2000-11-25
| | | | | | | | | | | | it fixing Y,YY,YYY,YYYY conversion, the docs and regress tests update are included too. During the patch testing I found small bug in miscadmin.h in convertstr() declaration. Here it's fixed too. Thanks Karel
* Fix for bitsubstr when third argument is missing (i.e., -1).Peter Eisentraut2000-11-22
| | | | From Adriaan Joubert <a.joubert@albourne.com>
* Put external declarations into header files.Peter Eisentraut2000-11-21
|
* Add missing #include <errno.h>.Tom Lane2000-11-21
|
* keep relations open until they are no longer needed.Hiroshi Inoue2000-11-21
|
* Make oidin/oidout produce and consume unsigned representation of Oid,Tom Lane2000-11-21
| | | | | | | | | | | | rather than just being aliases for int4in/int4out. Give type Oid a full set of comparison operators that do proper unsigned comparison, instead of reusing the int4 comparators. Since pg_dump is now doing unsigned comparisons of OIDs, it is now *necessary* that we play by the rules here. In fact, given that btoidcmp() has been doing unsigned comparison for quite some time, it seems likely that we have index- corruption problems in 7.0 and before once the Oid counter goes past 2G. Fixing these operators is a necessary step before we can think about 8-byte Oid, too.
* Modify input and output routines to print plain binary strings without anyPeter Eisentraut2000-11-18
| | | | 'b' prefixes.
* Suppress 'comparison-is-always-true' warning on machinesTom Lane2000-11-18
| | | | where char is signed by default.
* Modify locale code to defend against possibility that it was compiledTom Lane2000-11-18
| | | | | | | | | | with an -fsigned-char/-funsigned-char setting opposite to that of libc, thus breaking the convention that 'undefined' values returned by localeconv() are represented by CHAR_MAX. It is sheer stupidity that gcc even has such a switch --- it's just as bad as the structure-packing control switches offered by the more brain-dead PC compilers --- and as for the behavior of Linux distribution vendors who set RPM_OPT_FLAGS differently from the way they built libc, well, words fail me...
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-16
| | | | | | | maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
* Print bit values as binary strings (not hex)Peter Eisentraut2000-11-16
|
* Clean up array-dimensions parser a bit.Tom Lane2000-11-14
| | | | This code still needs a lot of love, however ...
* Allow interpretation of INTERVALs with more timezone-like syntax.Thomas G. Lockhart2000-11-11
| | | | | | Define conversions to and from text for date, time, and timetz. Have millisecond and microsecond return full # of seconds in those units. Previously, only returned full fractional part in those units.
* Adjust INET/CIDR display conventions and reimplement some INET/CIDRTom Lane2000-11-10
| | | | | | | functions, per recent discussions on pghackers. For now, I have called the verbose-display formatting function text(), but will reconsider if enough people object. initdb forced.
* Use SearchSysCacheTupleCopy() instead of SearchSysCacheTuple() inHiroshi Inoue2000-11-10
| | | | | order to continue to access the tuple more than now. This would resolve a segmentation fault error.
* This somehow gets moot. Is there a way to make gcc reject those comments?Bruce Momjian2000-11-07
| | | | Andreas
* Fix INTERVAL output when year/month has different sign as day/hour etc.Thomas G. Lockhart2000-11-06
| | | | | | | | | | | | | | Previously, all fields were unsigned, with only a trailing "ago" to indicate negative intervals. Now, ISO format does not use "ago", and and the traditional PostgreSQL format has the first numeric field unsigned with "ago" supporting that field. So "1 month - 2 days ago" is two days less than a month in the past. Fix interval arithmetic across daylight savings time boundaries. Previously, most math across boundaries introduced a one hour offset. Allow some date/time functions to return NULL if called with NULL args. Implement functions for AT TIME ZONE support. Support "SAT" as an Australian time zone if USE_AUSTRALIAN_RULES is defined.
* Allow ORDER BY, LIMIT in sub-selects. Fix most (not all) cases whereTom Lane2000-11-05
| | | | | | the grammar did not allow redundant parentheses around sub-selects. Distinguish LIMIT ALL from LIMIT 0; make the latter behave as one would expect.
* Fix bug reported by bobson: aclinsert3 would delete the 'world' entryTom Lane2000-11-03
| | | | | from an ACL list if it had no permissions remaining, which confused aclcheck terribly. Also clean up code a little.
* Change the parser to convert SQL "position" and "substring" syntax toPeter Eisentraut2000-10-31
| | | | | | | | | | position() and substring() functions, so that it works transparently for bit types as well. Alias the text functions appropriately. Add position() for bit types. Add new constant node T_BitString that represents literals of the form B'1001 and pass those to zpbit type.
* USE_POSIX_TIME replaced by HAVE_TM_ZONE || HAVE_INT_TIMEZONE, which arePeter Eisentraut2000-10-29
| | | | | | | | equivalent. In linux.h there were some #undef HAVE_INT_TIMEZONE, which are useless because HAVE_TM_ZONE overrides it anyway, and messing with configure results isn't cool.