aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAge
* Avoid division by zero in estimate_num_groups() when table has no rows.Tom Lane2003-10-16
|
* During ALTER TABLE ADD FOREIGN KEY, try to check the existing rows usingTom Lane2003-10-06
| | | | | | a single LEFT JOIN query instead of firing the check trigger for each row individually. Stephan Szabo, with some kibitzing from Tom Lane and Jan Wieck.
* Fix pg_get_constraintdef() to ensure CHECK constraints are always shownTom Lane2003-10-04
| | | | | | | with required outer parentheses. Breakage seems to be leftover from domain-constraint patches. This could be smarter about suppressing extra parens, but at this stage of the release cycle I want certainty not cuteness.
* When dumping CREATE INDEX, must show opclass name if the opclass isn'tTom Lane2003-10-02
| | | | | | 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.
* Repair RI trigger visibility problems (this time for sure ;-)) per recentTom Lane2003-10-01
| | | | | | | 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.
* The brackets aren't put on the CHECK constraints properly.Bruce Momjian2003-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* More message editing, some suggested by Alvaro HerreraPeter Eisentraut2003-09-29
|
* Now that we have UPDATE tab SET col = DEFAULT, get rid of horrid hackTom Lane2003-09-28
| | | | | | 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.
* Various message fixes, among those fixes for the previous round of fixesPeter Eisentraut2003-09-26
|
* Get rid of ReferentialIntegritySnapshotOverride by extending Executor APITom Lane2003-09-25
| | | | | | 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.
* Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut2003-09-25
| | | | | terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
* OK, some of these syntax errors should be given other codes.Peter Eisentraut2003-09-15
|
* Okay, I've had it with mktime() bugs. While chasing Torello Querci'sTom Lane2003-09-13
| | | | | | | | 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.
* Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut2003-09-09
| | | | | feature they complain about isn't a feature or cannot be implemented without definitional changes.
* Repair problems with to_char() overrunning its input string.Tom Lane2003-09-03
| | | | From Karel Zak.
* Adjust date/time input parsing code to correctly distinguish the fourTom Lane2003-08-27
| | | | | | | 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.
* Call it Linux, not GNU/Linux.Bruce Momjian2003-08-26
|
* Add the Brazilian time zone abbreviations BRT, BRST, FNT, FNST.Tom Lane2003-08-25
| | | | | ACT and ACST were already present. AMT and AMST conflict with the existing entries for Armenia; no change there for the moment.
* Allow parsing of time and timetz inputs to accept the documented inputTom Lane2003-08-25
| | | | | 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.
* Refactor code so that to_date() does not call to_timestamp() and thenTom Lane2003-08-25
| | | | | | | 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.
* Fix ARRAY[] construct so that in multidimensional case, elements canTom Lane2003-08-17
| | | | | | | | 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
* Create a 'type cache' that keeps track of the data needed for any particularTom Lane2003-08-17
| | | | | | | | | | | 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.
* Rewrite array_cmp to not depend on deconstruct_array. Should be a littleTom Lane2003-08-15
| | | | | 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-14
| | | | Christopher Kings-Lynne
* Rewriter and planner should use only resno, not resname, to identifyTom Lane2003-08-11
| | | | | | | 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-11
| | | | | | | | 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-08
|
* Fix floating-point timestamp comparisons to not go nuts if NaN isTom Lane2003-08-08
| | | | | | 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-05
| | | | | | 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-05
| | | | | | 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-04
| | | | so it won't miss 'em again.
* Remove --enable-recode feature, since it's been broken by IPv6 changes,Tom Lane2003-08-04
| | | | and seems to have too few users to justify maintaining.
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* inet_recv() wasn't IPv6-ready.Tom Lane2003-08-01
|
* Fix inconsistent static-vs-not-static declarations.Tom Lane2003-08-01
|
* Add pretty-printing variants of pg_get_viewdef and related functions.Tom Lane2003-07-30
| | | | Patch from Andreas Pflug.
* Fix numeric_smaller, numeric_larger, float4smaller, float4larger,Tom Lane2003-07-30
| | | | | | | | 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-29
| | | | | | | | | 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-28
|
* Error message editing in utils/adt. Again thanks to Joe Conway for doingTom Lane2003-07-27
| | | | the bulk of the heavy lifting ...
* This makes the initcap function compatible with Oracle 9i, it has beenBruce Momjian2003-07-27
| | | | | | tested on both redhat 8 and FreebSD. -- Mike Nolan
* I corecting date_trunc('quarter',...) and friends because orig versionBruce Momjian2003-07-26
| | | | | | 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-24
|
* Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000.Tom Lane2003-07-24
|
* Error message editing for foreign-key triggers.Tom Lane2003-07-22
|
* Oh, for crying in a bucket ... relax Assert so that glibc's strxfrmTom Lane2003-07-17
| | | | does not dump core.
* Work around buggy strxfrm() present in some Solaris releases.Tom Lane2003-07-17
|
* Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL conventionTom Lane2003-07-17
| | | | | | 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-14
|