aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
Commit message (Collapse)AuthorAge
* First phase of implementing hash-based grouping/aggregation. An AGG planTom Lane2002-11-06
| | | | | | | | | | | | | node now does its own grouping of the input rows, and has no need for a preceding GROUP node in the plan pipeline. This allows elimination of the misnamed tuplePerGroup option for GROUP, and actually saves more code in nodeGroup.c than it costs in nodeAgg.c, as well as being presumably faster. Restructure the API of query_planner so that we do not commit to using a sorted or unsorted plan in query_planner; instead grouping_planner makes the decision. (Right now it isn't any smarter than query_planner was, but that will change as soon as it has the option to select a hash- based aggregation step.) Despite all the hackery, no initdb needed since only in-memory node types changed.
* Code review for recent patch to allow ALTER TABLE ADD COLUMN whenTom Lane2002-11-02
| | | | | | a child table already has a matching column. Acquire appropriate lock on child table; do the right thing with any CHECK constraints attached to the new parent column.
* During swap_relfilenodes, swap relation size statistic fields along withTom Lane2002-11-02
| | | | | the relfilenode and toast fields. This ensures that the newly-computed statistics will be available on completion of CLUSTER.
* Remove encoding lookups from grammar stage, push them back to placesTom Lane2002-11-02
| | | | | | where it's safe to do database access. Along the way, fix core dump for 'DEFAULT' parameters to CREATE DATABASE. initdb forced due to change in pg_proc entry.
* Fix permissions-checking bugs and namespace-search-path bugs inTom Lane2002-11-02
| | | | | CONVERSION code. Still need to figure out what to do about inappropriate coding in parsing.
* Reduce messages associated with shell-type function arguments/resultsTom Lane2002-11-01
| | | | from WARNING to NOTICE, since they are expected messages in common cases.
* Fix miscalculation of remaining free space during tuple chain moving.Tom Lane2002-10-31
| | | | | | | Only affects machines where MAXALIGN > 4, and is a boundary-condition case even there, but still surprising that it's not been identified before. Also reduce tuple chain move give-up messages from WARNING to DEBUG1, since they are not unexpected conditions.
* Fix places that were using IsTransactionBlock() as an (inadequate) checkTom Lane2002-10-21
| | | | | | that they'd get to commit immediately on finishing. There's now a centralized routine PreventTransactionChain() that implements the necessary tests.
* Fix ALTER TABLE ... ADD COLUMN for inheritance cases.Bruce Momjian2002-10-21
| | | | Alvaro Herrera
* Avoid using IsTransactionBlock() in DeferredTriggerSetState(); no realTom Lane2002-10-21
| | | | need for this optimization, and it's too easily fooled anyway.
* Make CREATE/ALTER/DROP USER/GROUP transaction-safe, or at least prettyTom Lane2002-10-21
| | | | | nearly so, by postponing write of flat password file until transaction commit.
* Invert logic in pg_exec_query_string() so that we set a snapshot forTom Lane2002-10-19
| | | | | | | all utility statement types *except* a short list, per discussion a few days ago. Add missing SetQuerySnapshot calls in VACUUM and REINDEX, and guard against calling REINDEX DATABASE from a function (has same problem as VACUUM).
* Back out Alvaro's patch until regression tests pass.Bruce Momjian2002-10-19
|
* Fix compile failure caused by new patch.Bruce Momjian2002-10-19
|
* > Huh, I don't know where I got the idea you were (or someone else was?)Bruce Momjian2002-10-19
| | | | | | | | | | | | | | > in the position that attislocal should be reset. I'll clean everything > up and submit the patch I had originally made. All right, this is it. This patch merely checks if child tables have the column. If atttypid and atttypmod are the same, the attributes' attinhcount is incremented; else the operation is aborted. If child tables don't have the column, recursively add it. attislocal is not touched in any case. Alvaro Herrera
* Add missing #include <errno.h>.Tom Lane2002-10-19
|
* Arrange to copy relcache's trigdesc structure at the start of anyTom Lane2002-10-14
| | | | | | | | | | | | query that uses it. This ensures that triggers will be applied consistently throughout a query even if someone commits changes to the relation's pg_class.reltriggers field meanwhile. Per crash report from Laurette Cisneros. While at it, simplify memory management in relcache.c, which no longer needs the old hack to try to keep trigger info in the same place over a relcache entry rebuild. (Should try to fix rd_att and rewrite-rule access similarly, someday.) And make RelationBuildTriggers simpler and more robust by making it build the trigdesc in working memory and then CopyTriggerDesc() into cache memory.
* As Niel so nicely pointed out this morning, the output of EXPLAINBruce Momjian2002-10-14
| | | | | | | | | | ANALYZE is not quite clear when branches of the query are never executed. So this tiny patch fixes that. The patch is attached and can also be found at: http://svana.org/kleptog/pgsql/pgsql-explain.patch Martijn van Oosterhout
* Lock on the rule relation wasn't removed after adding the comment.Bruce Momjian2002-10-09
| | | | | | Added Tom's patch fix for heap_close. Rod Taylor
* Restrict CREATE OPERATOR CLASS to superusers, per discussion some weeksTom Lane2002-10-04
| | | | ago.
* Require superuser privilege to create a binary-compatible cast, perTom Lane2002-10-04
| | | | | | discussion some weeks ago. Also, add a check that two types to be binary-equivalenced match as to typlen, typbyval, and typalign; if they don't then it's surely a mistake to equivalence them.
* Hack to make it possible to load CREATE CONSTRAINT TRIGGER commands thatTom Lane2002-10-03
| | | | | are missing the FROM clause (due to a long-ago pg_dump bug). Patch by Stephan Szabo, minor tweaking by Tom Lane.
* Make the world at least somewhat safe for zero-column tables, andTom Lane2002-09-28
| | | | | remove the special case in ALTER DROP COLUMN to prohibit dropping a table's last column.
* ARGH!Tom Lane2002-09-27
| | | | | | | | Vacuum must not advance pg_database.datvacuumxid nor truncate CLOG unless it's processed *all* tables in the database. Vacuums run by unprivileged users don't count. (Beats head against nearest convenient wall...)
* Further thinking about heap_mark4update: in HeapTupleSelfUpdated case,Tom Lane2002-09-23
| | | | | | | | | executor should not return the tuple as successfully marked, because in fact it's been deleted. Not clear that this case has ever been seen in practice (I think you'd have to write a SELECT FOR UPDATE that calls a function that deletes some row the SELECT will visit later...) but we should be consistent. Also add comments to several other places that got it right but didn't explain what they were doing.
* Disallow VACUUM, ANALYZE, TRUNCATE on temp tables belonging to otherTom Lane2002-09-23
| | | | | backends. Given that temp tables now store data locally in the local buffer manager, these things are not going to work safely.
* Get rid of bogus use of heap_mark4update in reindex operations (cf.Tom Lane2002-09-23
| | | | | recent bug report). Fix processing of nailed-in-cache indexes; it appears that REINDEX DATABASE has been broken for months :-(.
* Replace pg_attribute.attisinherited with attislocal and attinhcountTom Lane2002-09-22
| | | | | columns, to allow more correct behavior in multiple-inheritance cases. Patch by Alvaro Herrera, review by Tom Lane.
* Move most of the error checking for foreign-key constraints out ofTom Lane2002-09-22
| | | | | | | | | | | | | | | | | | | | | | parse analysis and into the execution code (in tablecmds.c). This eliminates a lot of unreasonably complex code that needed to have two or more execution paths in case it was dealing with a not-yet-created table column vs. an already-existing one. The execution code is always dealing with already-created tables and so needs only one case. This also eliminates some potential race conditions (the table wasn't locked between parse analysis and execution), makes it easy to fix the gripe about wrong referenced-column names generating a misleading error message, and lets us easily add a dependency from the foreign-key constraint to the unique index that it requires the referenced table to have. (Cf. complaint from Kris Jurka 12-Sep-2002 on pgsql-bugs.) Also, third try at building a deletion mechanism that is not sensitive to the order in which pg_depend entries are visited. Adding the above- mentioned dependency exposed the folly of what dependency.c had been doing: it failed for cases where B depends on C while both auto-depend on A. Dropping A should succeed in this case, but was failing if C happened to be visited before B. It appears the only solution is two separate walks over the dependency tree.
* Provide an upgrade strategy for dump files containing functions declaredTom Lane2002-09-21
| | | | | | | | with OPAQUE. CREATE LANGUAGE, CREATE TRIGGER, and CREATE TYPE will all accept references to functions declared with OPAQUE --- but they will issue a NOTICE, and will modify the function entries in pg_proc to have the preferred type-safe argument or result types instead of OPAQUE. Per recent pghackers discussions.
* Performance improvement for MultiRecordFreeSpace on large relations ---Tom Lane2002-09-20
| | | | | avoid O(N^2) behavior. Problem noted and fixed by Stephen Marshall <smarshall@wsicorp.com>, with some help from Tom Lane.
* Code review for check-domain-constraints-in-COPY patch. Do correct thingTom Lane2002-09-20
| | | | | when default expression for a domain is being used. Avoid repetitive catalog lookups.
* Change domain patch to COERCE_IMPLICIT_CAST, per Tom.Bruce Momjian2002-09-20
|
* Fix compile error from Rod's patch.Bruce Momjian2002-09-20
|
* Fixed this problem and added regression tests in domain.sql.Bruce Momjian2002-09-20
| | | | | | | | Also: - Changed header file order (alphabetical) - Changed to m = attnum - 1 in binary copy code for consistency Rod Taylor
* > I'm not sure why NDirectFileRead/NDirectFileWrite are unused at theBruce Momjian2002-09-20
| | | | | | | | | | | | | | | > moment, but they used to be used; I think the correct response is to > put back the missing counter increments, not rip out the counters. Ok, fair enough. It's worth noting that they've been broken for a while -- for example, the HashJoin counter increments were broken when you comitted r1.20 of executor/nodeHashJoin.c in May of '99. I've attached a revised patch that doesn't remove the counters (but doesn't increment them either: I'm not sure of all the places where the counter should be incremented). Neil Conway
* Tweak heap.c to refuse attempts to create table columns of standaloneTom Lane2002-09-19
| | | | | | composite types. Add a couple more lsyscache.c routines to support this, and make use of them in some other places that were doing lookups the hard way.
* Department of second thoughts: suppressing implicit casts everywhere inTom Lane2002-09-19
| | | | | | | | ruleutils display is not such a great idea. For arguments of functions and operators I think we'd better keep the historical behavior of showing such casts explicitly, to ensure that the function/operator is reparsed the same way when the rule is reloaded. This also makes the output of EXPLAIN less obscurantist about exactly what's happening.
* Extend pg_cast castimplicit column to a three-way value; this allows usTom Lane2002-09-18
| | | | | | | | | | | | | | | | | | | | | | | | to be flexible about assignment casts without introducing ambiguity in operator/function resolution. Introduce a well-defined promotion hierarchy for numeric datatypes (int2->int4->int8->numeric->float4->float8). Change make_const to initially label numeric literals as int4, int8, or numeric (never float8 anymore). Explicitly mark Func and RelabelType nodes to indicate whether they came from a function call, explicit cast, or implicit cast; use this to do reverse-listing more accurately and without so many heuristics. Explicit casts to char, varchar, bit, varbit will truncate or pad without raising an error (the pre-7.2 behavior), while assigning to a column without any explicit cast will still raise an error for wrong-length data like 7.3. This more nearly follows the SQL spec than 7.2 behavior (we should be reporting a 'completion condition' in the explicit-cast cases, but we have no mechanism for that, so just do silent truncation). Fix some problems with enforcement of typmod for array elements; it didn't work at all in 'UPDATE ... SET array[n] = foo', for example. Provide a generalized array_length_coerce() function to replace the specialized per-array-type functions that used to be needed (and were missing for NUMERIC as well as all the datetime types). Add missing conversions int8<->float4, text<->numeric, oid<->int8. initdb forced.
* Fix for rare race-condition-like failure: if a backend receives SIGUSR2Tom Lane2002-09-16
| | | | | | | | | | (notify/SI-overrun interrupt) while it is in process of doing proc_exit, it is possible for Async_NotifyHandler() to try to start a transaction when one is already running. This leads to Asserts() or worse. I think it may only be possible to occur when frontend synchronization is lost (ie, the elog(FATAL) in SocketBackend() fires), but that is a standard occurrence after error during COPY. In any case, I have seen this failure occur during regression tests, so it is definitely possible.
* Cast functions can be immutable or stable.Peter Eisentraut2002-09-15
|
* Cosmetic fixes from Neil Conway.Tom Lane2002-09-14
|
* Translation updatesPeter Eisentraut2002-09-14
|
* Fix likely cause of rare ALTER TABLE ADD FOREIGN KEY failures ---Tom Lane2002-09-12
| | | | | don't assume relname field of a relcache entry will stay valid across lots of operations.
* Remove heap_mark4update from AlterTableCreateToastTable. This hasTom Lane2002-09-06
| | | | | | never been the correct procedure for locking a relation, and the recently-found ALTER TABLE bug with adding a constraint and a toast table in the same command shows why it's a bad idea.
* pgindent run.Bruce Momjian2002-09-04
|
* Arrange for the default permissions on a database to allow temp tableTom Lane2002-09-03
| | | | | | | creation to world, but disallow temp table creation in template1. Per latest round of pghackers discussion. I did not force initdb, but the permissions lockdown on template1 will not take effect unless you do one (or manually REVOKE TEMP ON DATABASE template1 FROM public).
* Remove all traces of multibyte and locale options. Clean up commentsPeter Eisentraut2002-09-03
| | | | referring to "multibyte" where it really means character encoding.
* Workaround for format strings that are concatenated from macrosPeter Eisentraut2002-09-03
| | | | (INT64_FORMAT), which gettext cannot handle.
* Code review and documentation updates for indisclustered patch.Tom Lane2002-09-03
|