summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2007-01-03Fix regex_fixed_prefix() to cope reasonably well with regex patterns of theTom Lane
form '^(foo)$'. Before, these could never be optimized into indexscans. The recent changes to make psql and pg_dump generate such patterns (for \d commands and -t and related switches, respectively) therefore represented a big performance hit for people with large pg_class catalogs, as seen in recent gripe from Erik Jones. While at it, be more paranoid about case-sensitivity checking in multibyte encodings, and fix some other corner cases in which a regex might be interpreted too liberally.
2006-05-21Change the backend to reject strings containing invalidly-encoded multibyteTom Lane
characters in all cases. Formerly we mostly just threw warnings for invalid input, and failed to detect it at all if no encoding conversion was required. The tighter check is needed to defend against SQL-injection attacks as per CVE-2006-2313 (further details will be published after release). Embedded zero (null) bytes will be rejected as well. The checks are applied during input to the backend (receipt from client or COPY IN), so it no longer seems necessary to check in textin() and related routines; any string arriving at those functions will already have been validated. Conversion failure reporting (for characters with no equivalent in the destination encoding) has been cleaned up and made consistent while at it. Also, fix a few longstanding errors in little-used encoding conversion routines: win1251_to_iso, win866_to_iso, euc_tw_to_big5, euc_tw_to_mic, mic_to_euc_tw were all broken to varying extents. Patches by Tatsuo Ishii and Tom Lane. Thanks to Akio Ishida and Yasuo Ohgaki for identifying the security issues.
2006-05-21Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,Bruce Momjian
and 8.0. Later releases already patched.
2006-01-05Arrange to set the LC_XXX environment variables to match our locale setup.Tom Lane
Back-patch of previous fix in HEAD for plperl-vs-locale issue.
2005-12-22Adjust string comparison so that only bitwise-equal strings are consideredTom Lane
equal: if strcoll claims two strings are equal, check it with strcmp, and sort according to strcmp if not identical. This fixes inconsistent behavior under glibc's hu_HU locale, and probably under some other locales as well. Also, take advantage of the now-well-defined behavior to speed up texteq, textne, bpchareq, bpcharne: they may as well just do a bitwise comparison and not bother with strcoll at all. NOTE: affected databases may need to REINDEX indexes on text columns to be sure they are self-consistent.
2005-04-23Repair two TIME WITH TIME ZONE bugs found by Dennis Vshivkov. ComparisonTom Lane
of timetz values misbehaved in --enable-integer-datetime cases, and EXTRACT(EPOCH) subtracted the zone instead of adding it in all cases. Backpatch to all supported releases (except --enable-integer-datetime code does not exist in 7.2).
2005-04-20Fix mis-display of negative fractional seconds in interval values forTom Lane
--enable-integer-datetimes case. Per report from Oliver Siegmar.
2005-03-26Prevent to_char(interval) from dumping core on month-related formatsTom Lane
when a zero-month interval is given. Per discussion with Karel.
2005-01-11interval_out failed to mention 'ago' for negative intervals in SQL andTom Lane
GERMAN datestyles. Ancient bug reported by Terry Lee Tucker.
2004-12-17array_map failed to insert correct result type in an empty array.Tom Lane
Per example from Florian Pflug.
2004-10-13Repair possible failure to update hint bits back to disk, perTom Lane
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php. I plan a more permanent fix in HEAD, but for the back branches it seems best to just touch the places that actually have a problem.
2004-02-02Avoid generating invalid character encoding sequences in make_greater_string.Tom Lane
Not sure how this mistake evaded detection for so long.
2004-02-01Fix text_position to not scan past end of source string in multibyteJoe Conway
case, per report from Korea PostgreSQL Users' Group. Copied from Tom Lane's 7.4 branch patch.
2003-12-07Repair indexed bytea like operations, and related selectivityJoe Conway
functionality. Per bug report by Alvar Freude: http://archives.postgresql.org/pgsql-bugs/2003-12/msg00022.php
2003-11-30Make PQescapeBytea and byteaout consistent with each other, andJoe Conway
octal escape all octets outside the range 0x20 to 0x7e. This fixes the problem pointed out by Sergey Yatskevich here: http://archives.postgresql.org/pgsql-bugs/2003-11/msg00140.php
2003-10-31Fix for possible referential integrity violation when a qualified ON INSERTJan Wieck
rule split the query into one INSERT and one UPDATE where the UPDATE then hit's the just created row without modifying the key fields again. In this special case, the new key slipped in totally unchecked. Jan
2003-10-02When dumping CREATE INDEX, must show opclass name if the opclass isn'tTom Lane
in the schema search path. Otherwise pg_dump doesn't correctly dump scenarios where a custom opclass is created in 'public' and then used by indexes in other schemas.
2003-09-03Back-patch the other part of Karel's formatting bug fix.Tom Lane
2003-09-03Repair problems with to_char() overrunning its input string.Tom Lane
From Karel Zak.
2003-08-05Fix several places where fractional-second inputs were misprocessedTom Lane
in HAVE_INT64_TIMESTAMP cases, including two potential stack smashes when more than six fractional digits were supplied. Per bug report from Philipp Reisner.
2003-07-24Fix timestamp_date for HAVE_INT64_TIMESTAMP case.REL7_3_4Tom Lane
2003-07-24Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000.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-14Fix a *second* buffer overrun bug in to_ascii(). Grumble.Tom Lane
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-05-21Back-patch Jan's fix to avoid primary key lookup (and lock) if foreign keyTom Lane
does not change on UPDATE.
2003-05-04Allow 60 in seconds fields of timestamp, time, interval input values.Tom Lane
Per recent discussion on pgsql-general, this is appropriate for spec compliance, and has the nice side-effect of easing porting from old pg_dump files that exhibit the 59.999=>60.000 roundoff problem.
2003-04-26Repair permissions problem in RI triggers: query parsing has to be doneTom Lane
as the correct user, not only query execution. Per report from Sean Chittenden.
2003-04-23Fix misbehavior of replace() on strings containing '%'.Tom Lane
Will patch separately but equivalently in HEAD.
2003-04-16Fix stupid oversight ...Tom Lane
2003-04-15eqjoinsel's logic for case where MCV lists are not present shouldTom Lane
account for NULLs; in hindsight this is obvious since the code for the MCV-lists case would reduce to this when there are zero entries in both lists. Per example from Alec Mitchell.
2003-04-02Fix buffer overrun in to_ascii(), per report from Guido Notari.Tom Lane
2003-03-27Fix bogus coding of SET DEFAULT ri triggers ... or at least make it lessTom Lane
bogus than it was. Per bug report from Adrian Pop.
2003-03-23Tweak selectivity and related routines to cope with domains. Per reportTom Lane
from Andreas Pflug.
2003-03-14Prevent infinite loop in ln_var() due to roundoff error.Tom Lane
Per report from Dave Marin.
2003-02-27Change EXTRACT(EPOCH FROM timestamp) so that a timestamp without time zoneTom Lane
is assumed to be in local time, not GMT. This improves consistency with other operations, which all assume local timezone when it matters. Per bug #897.
2003-02-20Fix timestamptz_in so that parsing of 'now'::timestamptz gives rightTom Lane
answer when SET TIMEZONE has been done since the start of the current transaction. Per bug report from Robert Haas. I plan some futher cleanup in HEAD, but this is a low-risk patch for the immediate issue in 7.3.
2003-02-13Prevent timetz2tm() from scribbling on its input in HAVE_INT64_TIMESTAMP case.Tom Lane
2003-01-29Repair array subscript overrun identified by Yichen Xie. Reduce theTom Lane
value of MAX_TIME_PRECISION in floating-point-timestamp-storage case from 13 to 10, which is as much as time_out is actually willing to print. (The alternative of increasing the number of digits we are willing to print looks risky; we might find ourselves printing roundoff garbage.)
2003-01-22Make estimation of mergejoin scan selectivities more robust, per recentTom Lane
example from RaÇl GutiÅrrez.
2003-01-16Repair an embarrassingly large number of alphabetization mistakes in theTom Lane
datetime token tables. Even more embarrassing, the regression tests revealed some of the problems --- but evidently the bogus output wasn't questioned. Add code to postmaster startup to directly check the tables for correct ordering, in hopes of not being embarrassed like this again.
2003-01-09Repair inconsistent rounding behavior for timestamp, time, interval,Tom Lane
per gripe from Csaba Nagy. There is still potential for platform-specific behavior for values that are exactly halfway between integers, but at least we now get the expected answer for all other cases.
2003-01-08Fix dumping of DEFERRABLE/INITIALLY DEFERRED:Bruce Momjian
> The big problem is that while pg_dump's dump_trigger() looks at > tginitdeferred and dumps accordingly, pg_get_constraintdef doesn't look > at tginitdeferred, and therefore doesn't record the requirement as part > of ALTER TABLE ADD CONSTRAINT. pg_get_constraintdef should probably be looking at condeferrable and condeferred in the pg_constraint row it's looking at. Maybe something like the attached. (Added, output only non-default values.) Stephan Szabo
2002-12-30Point does not return a center of lseg.Tom Lane
Kenji Sugita
2002-12-12Guard against overrunning CTZName buffer when TZ is bogus.Tom Lane
2002-11-29Repair prehistoric logic error in lseg_eq and lseg_ne.Tom Lane
2002-11-21Fix breakage in new-in-7.3 timetz_zone() function: was giving randomTom Lane
results due to doing arithmetic on uninitialized values. Add some documentation about the AT TIME ZONE construct. Update some other date/time documentation that seemed out of date for 7.3.
2002-11-13Allow +1300 as a numeric timezone specifier; we already accept FJST as ↵Tom Lane
meaning +1300.
2002-11-12Remove NO_MKTIME_BEFORE_1970. I had speculated that it was not neededTom Lane
anymore given the mktime() workaround now done in DetermineLocalTimeZone. This has now been confirmed by Robert Bruccoleri for Irix, and I'm going to extrapolate to AIX as well.