summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2001-01-03Repair always-broken date_part('quarter',timestamp).Thomas G. Lockhart
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.
2000-12-28Let's try this again on accepting the correct range of Oid input valuesTom Lane
for 64-bit platforms ...
2000-12-27Fix portability problems recently exposed by regression tests on Alphas.Tom Lane
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.
2000-12-23Replace overly-cute coding with code that (a) has defined behaviorTom Lane
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.
2000-12-22Repair not-too-well-thought-out code to do rangechecking of OIDs onTom Lane
64-bit machines. Also, make oidvectorin use the same code as oidin.
2000-12-22Add 'ONLY' to queries generated by RI triggers, so as to preserve pre-7.1Tom Lane
semantics of RI operations. Eventually we ought to look at making RI work properly across inheritance trees, but not for 7.1 ...
2000-12-22Change default output formatting for CIDR to be unabbreviated, perTom Lane
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.
2000-12-15here is a patch fixing today's bug report:Bruce Momjian
> 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
2000-12-11Fix ILIKE bug (only in multi-byte case)Tatsuo Ishii
2000-12-09Portability fix from Ryan Kirkpatrick's Alpha patches. I believe thisTom Lane
is the only diff not accounted for by fmgr rewrite...
2000-12-08Repair erroneous use of hashvarlena() for MACADDR, which is not aTom Lane
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.
2000-12-07Change lpad() and rpad() to behave more Oracle-compatibly when targetTom Lane
length is less than original string length.
2000-12-07Make OVERLAPS operators conform to SQL92 spec regarding NULL handling.Tom Lane
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.
2000-12-07Silence compiler warning.Tom Lane
2000-12-03Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
2000-12-03Repair usage of the OVERLAPS operator.Thomas G. Lockhart
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.
2000-12-01It seems appropriate that the extended MEMORY_CONTEXT_CHECKING codeTom Lane
immediately uncovered three of Karel's own bugs, including a routine that scribbled on its input (naughty naughty!)
2000-11-28aclitemout() shouldn't coredump when it finds an ACL itemTom Lane
for a now-vanished group. Instead, display the numeric group ID, same as it does for vanished users.
2000-11-26Fix for inserting/copying longer multibyte strings into bpchar dataTatsuo Ishii
types.
2000-11-25Make PGLC_setlocale() static, and document that it can't be used safelyTom Lane
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.
2000-11-25Fix some portability bugs I'd introduced into inet/cidr code ---Tom Lane
shifting by the word width is not defined by ANSI C...
2000-11-25Store current LC_COLLATE and LC_CTYPE settings in pg_control during initdb;Tom Lane
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.
2000-11-25 here is a patch for formatting.c (to_char/timestampt()), for 7.1Bruce Momjian
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
2000-11-22Fix for bitsubstr when third argument is missing (i.e., -1).Peter Eisentraut
From Adriaan Joubert <a.joubert@albourne.com>
2000-11-21Put external declarations into header files.Peter Eisentraut
2000-11-21Add missing #include <errno.h>.Tom Lane
2000-11-21keep relations open until they are no longer needed.Hiroshi Inoue
2000-11-21Make oidin/oidout produce and consume unsigned representation of Oid,Tom Lane
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.
2000-11-18Modify input and output routines to print plain binary strings without anyPeter Eisentraut
'b' prefixes.
2000-11-18Suppress 'comparison-is-always-true' warning on machinesTom Lane
where char is signed by default.
2000-11-18Modify locale code to defend against possibility that it was compiledTom Lane
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...
2000-11-16Change SearchSysCache coding conventions so that a reference count isTom Lane
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.
2000-11-16Print bit values as binary strings (not hex)Peter Eisentraut
2000-11-14Clean up array-dimensions parser a bit.Tom Lane
This code still needs a lot of love, however ...
2000-11-11Allow interpretation of INTERVALs with more timezone-like syntax.Thomas G. Lockhart
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.
2000-11-10Adjust INET/CIDR display conventions and reimplement some INET/CIDRTom Lane
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.
2000-11-10Use SearchSysCacheTupleCopy() instead of SearchSysCacheTuple() inHiroshi Inoue
order to continue to access the tuple more than now. This would resolve a segmentation fault error.
2000-11-07This somehow gets moot. Is there a way to make gcc reject those comments?Bruce Momjian
Andreas
2000-11-06Fix INTERVAL output when year/month has different sign as day/hour etc.Thomas G. Lockhart
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.
2000-11-05Allow ORDER BY, LIMIT in sub-selects. Fix most (not all) cases whereTom Lane
the grammar did not allow redundant parentheses around sub-selects. Distinguish LIMIT ALL from LIMIT 0; make the latter behave as one would expect.
2000-11-03Fix bug reported by bobson: aclinsert3 would delete the 'world' entryTom Lane
from an ACL list if it had no permissions remaining, which confused aclcheck terribly. Also clean up code a little.
2000-10-31Change the parser to convert SQL "position" and "substring" syntax toPeter Eisentraut
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.
2000-10-29USE_POSIX_TIME replaced by HAVE_TM_ZONE || HAVE_INT_TIMEZONE, which arePeter Eisentraut
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.
2000-10-27Disallow bits beyond the mask length for CIDR values, per discussionTom Lane
on pghackers. Arrange for the sort ordering of general INET values to be network part as major sort key, host part as minor sort key. I did not force an initdb for this change, but anyone who's running indexes on general INET values may need to recreate those indexes.
2000-10-26Re-implement LIMIT/OFFSET as a plan node type, instead of a hack inTom Lane
ExecutorRun. This allows LIMIT to work in a view. Also, LIMIT in a cursor declaration will behave in a reasonable fashion, whereas before it was overridden by the FETCH count.
2000-10-25Minor cleanup.Tom Lane
2000-10-24Integer binary operators, from Marko Kreen <marko@l-t.ee>. Renamed bitxorPeter Eisentraut
operator to '#' for consistency. Parser still needs work.
2000-10-22Makeover for Unixware 7.1.1Peter Eisentraut
* Makefile: Add more standard targets. Improve shell redirection in GNU make detection. * src/backend/access/transam/rmgr.c: Fix incorrect(?) C. * src/backend/libpq/pqcomm.c (StreamConnection): Work around accept() bug. * src/include/port/unixware.h: ...with help from here. * src/backend/nodes/print.c (plannode_type): Remove some "break"s after "return"s. * src/backend/tcop/dest.c (DestToFunction): ditto. * src/backend/nodes/readfuncs.c: Add proper prototypes. * src/backend/utils/adt/numutils.c (pg_atoi): Cope specially with strtol() setting EINVAL. This saves us from creating an extra set of regression test output for the affected systems. * src/include/storage/s_lock.h (tas): Correct prototype. * src/interfaces/libpq/fe-connect.c (parseServiceInfo): Don't use variable as dimension in array definition. * src/makefiles/Makefile.unixware: Add support for GCC. * src/template/unixware: same here * src/test/regress/expected/abstime-solaris-1947.out: Adjust whitespace. * src/test/regress/expected/horology-solaris-1947.out: Part of this file was evidently missing. * src/test/regress/pg_regress.sh: Fix shell. mkdir -p returns non-zero if the directory exists. * src/test/regress/resultmap: Add entries for Unixware.
2000-10-20Add support for VPATH builds, that is, building somewhere else than in thePeter Eisentraut
source directory. This involves mostly makefiles using $(srcdir) when they might have used ".". (Regression tests don't work with this, yet.) Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS). Add "override" keyword in most places, to preserve necessary flags even when the user overrode the flags.
2000-10-16Remove NO_SECURITY define.Bruce Momjian