summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
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-10-01Repair RI trigger visibility problems (this time for sure ;-)) per recentTom Lane
discussion on pgsql-hackers: in READ COMMITTED mode we just have to force a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have to run the scan under a current snapshot and then complain if any rows would be updated/deleted that are not visible in the transaction snapshot.
2003-09-29The brackets aren't put on the CHECK constraints properly.Bruce Momjian
Before patch: test=# select pg_get_constraintdef(oid) from pg_constraint; pg_get_constraintdef ------------------------------------------------------------------------------------------------- CHECK (VALUE >= 0) CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR ((a)::text = 'dfd'::text)) PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) test=# select pg_get_constraintdef(oid, true) from pg_constraint; pg_get_constraintdef ----------------------------------------------------------------------------------- CHECK VALUE >= 0 CHECK a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text = 'dfd'::text PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) After patch: test=# select pg_get_constraintdef(oid) from pg_constraint; pg_get_constraintdef ------------------------------------------------------------------------------------------------- CHECK (VALUE >= 0) CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR ((a)::text = 'dfd'::text)) PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) test=# select pg_get_constraintdef(oid, true) from pg_constraint; pg_get_constraintdef ----------------------------------------------------------------------------------- CHECK (VALUE >= 0) ` CHECK (a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text = 'dfd'::text) PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) It's important that those brackets are there to (a) match all other constraints and (b) so that people can just copy and paste them and it will work as SQL. Christopher Kings-Lynne
2003-09-29More message editing, some suggested by Alvaro HerreraPeter Eisentraut
2003-09-28Now that we have UPDATE tab SET col = DEFAULT, get rid of horrid hackTom Lane
in the RI triggers for ON DELETE/UPDATE SET DEFAULT. The code depended way too much on knowledge of plan structure, and yet still would fail if the generated query got rewritten by rules.
2003-09-26Various message fixes, among those fixes for the previous round of fixesPeter Eisentraut
2003-09-25Get rid of ReferentialIntegritySnapshotOverride by extending Executor APITom Lane
to allow es_snapshot to be set to SnapshotNow rather than a query snapshot. This solves a bug reported by Wade Klaver, wherein triggers fired as a result of RI cascade updates could misbehave.
2003-09-25Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut
terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
2003-09-15OK, some of these syntax errors should be given other codes.Peter Eisentraut
2003-09-13Okay, I've had it with mktime() bugs. While chasing Torello Querci'sTom Lane
recent gripe, I discovered not one but two undocumented, undesirable behaviors of glibc's mktime. So, stop using it entirely, and always rely on inversion of localtime() to determine the local time zone. It's not even very much slower, as it turns out that mktime (at least in the glibc implementation) also does repeated reverse-conversions.
2003-09-09Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut
feature they complain about isn't a feature or cannot be implemented without definitional changes.
2003-09-03Repair problems with to_char() overrunning its input string.Tom Lane
From Karel Zak.
2003-08-27Adjust date/time input parsing code to correctly distinguish the fourTom Lane
SQLSTATE error codes required by SQL99 (invalid format, datetime field overflow, interval field overflow, invalid time zone displacement value). Also emit a HINT about DateStyle in cases where it seems appropriate. Per recent gripes.
2003-08-26Call it Linux, not GNU/Linux.Bruce Momjian
2003-08-25Add the Brazilian time zone abbreviations BRT, BRST, FNT, FNST.Tom Lane
ACT and ACST were already present. AMT and AMST conflict with the existing entries for Armenia; no change there for the moment.
2003-08-25Allow parsing of time and timetz inputs to accept the documented inputTom Lane
syntax '040506' for '04:05:06', as well as '0405' for '04:05:00'. This has been broken since 7.2 but was only recently complained of.
2003-08-25Refactor code so that to_date() does not call to_timestamp() and thenTom Lane
perform a timestamp-to-date coercion. Instead both routines share a subroutine that delivers the parsing result as a struct tm. This avoids problems with timezone dependency of to_date's result, and should be at least marginally faster too.
2003-08-17Fix ARRAY[] construct so that in multidimensional case, elements canTom Lane
be anything yielding an array of the proper kind, not only sub-ARRAY[] constructs; do subscript checking at runtime not parse time. Also, adjust array_cat to make array || array comply with the SQL99 spec. Joe Conway
2003-08-17Create a 'type cache' that keeps track of the data needed for any particularTom Lane
datatype by array_eq and array_cmp; use this to solve problems with memory leaks in array indexing support. The parser's equality_oper and ordering_oper routines also use the cache. Change the operator search algorithms to look for appropriate btree or hash index opclasses, instead of assuming operators named '<' or '=' have the right semantics. (ORDER BY ASC/DESC now also look at opclasses, instead of assuming '<' and '>' are the right things.) Add several more index opclasses so that there is no regression in functionality for base datatypes. initdb forced due to catalog additions.
2003-08-15Rewrite array_cmp to not depend on deconstruct_array. Should be a littleTom Lane
faster, but more importantly does not leak memory. Still needs more work though, per my recent note to pgsql-hackers.
2003-08-14Handle double-quotes correctly in user names in ACL lists.Tom Lane
Christopher Kings-Lynne
2003-08-11Rewriter and planner should use only resno, not resname, to identifyTom Lane
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.
2003-08-11Code cleanup inspired by recent resname bug report (doesn't fix the bugTom Lane
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().
2003-08-08Another pgindent run with updated typedefs.Bruce Momjian
2003-08-08Fix floating-point timestamp comparisons to not go nuts if NaN isTom Lane
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.
2003-08-05Improve documentation of ParseDateTime(). Reorder tests to preventTom Lane
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.
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-08-04Fix some copyright notices that weren't updated. Improve copyright toolTom Lane
so it won't miss 'em again.
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.