summaryrefslogtreecommitdiff
path: root/src/backend
AgeCommit message (Collapse)Author
2002-11-06First phase of implementing hash-based grouping/aggregation. An AGG planTom Lane
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.
2002-11-04Remove unnecessary inclusion, per Andreas.Tom Lane
2002-11-04Remove no-longer-needed inclusion of bootstrap_tokens.h, per patchTom Lane
from Andreas.
2002-11-02Code review for recent patch to allow ALTER TABLE ADD COLUMN whenTom Lane
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.
2002-11-02During swap_relfilenodes, swap relation size statistic fields along withTom Lane
the relfilenode and toast fields. This ensures that the newly-computed statistics will be available on completion of CLUSTER.
2002-11-02Remove encoding lookups from grammar stage, push them back to placesTom Lane
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.
2002-11-02Clean up a few fprintf(stderr)'s that should be elog's.Tom Lane
2002-11-02Fix permissions-checking bugs and namespace-search-path bugs inTom Lane
CONVERSION code. Still need to figure out what to do about inappropriate coding in parsing.
2002-11-01Arrange to compile flex output files as inclusions into other filesTom Lane
(usually bison output files), not as standalone files. This hack works around flex's insistence on including <stdio.h> before we are able to include postgres.h; postgres.h will already be read before the compiler starts to read the flex output file. Needed for largefile support on some platforms.
2002-11-01Reduce a couple of debugging messages from LOG to DEBUG1 category.Tom Lane
2002-11-01Reduce messages associated with shell-type function arguments/resultsTom Lane
from WARNING to NOTICE, since they are expected messages in common cases.
2002-11-01After elog(PANIC), exit with abort() not proc_exit(). This allows aTom Lane
core file to be produced for debugging, and avoids trying to run the normal proc-exit cleanup hooks, which are likely to cause additional problems if the system is hosed.
2002-11-01Fix some bogus comments.Tom Lane
2002-10-31Add missing #include <errno.h>, per gripe from Alessio Bragadini.Tom Lane
2002-10-31Got tired of explaining why this Assert is not wrong.Tom Lane
2002-10-31Code review for statement_timeout patch. Fix some race conditionsTom Lane
between signal handler and enable/disable code, avoid accumulation of timing error due to trying to maintain remaining-time instead of absolute-end-time, disable timeout before commit not after.
2002-10-31Fix miscalculation of remaining free space during tuple chain moving.Tom Lane
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.
2002-10-31Avoid use of inline functions that are not declared static. Needed toTom Lane
conform to C99's brain-dead notion of how inline functions should work.
2002-10-31Clean up gram.y trailing spaces.Bruce Momjian
2002-10-26Add missing semicolons to a few PG_FUNCTION_INFO_V1 calls.Tom Lane
2002-10-24Fix some places that were unportably assuming struct timeval's tv_secTom Lane
field is signed. Clean up casting.
2002-10-24Function-call-style type coercions should be treated as explicitTom Lane
coercions, not implicit ones. For example, 'select abstime(1035497293)' should succeed because there is an explicit binary coercion from int4 to abstime.
2002-10-22Perform transaction cleanup operations in a less ad-hoc, moreTom Lane
principled order; in particular ensure that all shared resources are released before we release transaction locks. The code used to release locks before buffer pins, which might explain an ancient note I have about a bufmgr assertion failure I'd seen once several years ago, and been unable to reproduce since. (Theory: someone trying to drop a relation might be able to reach FlushRelationBuffers before the last user of the relation had gotten around to dropping his buffer pins.)
2002-10-21Fix places that were using IsTransactionBlock() as an (inadequate) checkTom Lane
that they'd get to commit immediately on finishing. There's now a centralized routine PreventTransactionChain() that implements the necessary tests.
2002-10-21Fix ALTER TABLE ... ADD COLUMN for inheritance cases.Bruce Momjian
Alvaro Herrera
2002-10-21Remove unnecessary (and inadequate) check of IsTransactionBlock() inTom Lane
pgstat_vacuum_tabstat(). Assume that caller (namely, VACUUM) has done the appropriate state checking beforehand.
2002-10-21Avoid using IsTransactionBlock() in DeferredTriggerSetState(); no realTom Lane
need for this optimization, and it's too easily fooled anyway.
2002-10-21Make CREATE/ALTER/DROP USER/GROUP transaction-safe, or at least prettyTom Lane
nearly so, by postponing write of flat password file until transaction commit.
2002-10-20Fix potential problem with btbulkdelete deleting an indexscan's currentTom Lane
item, if the page containing the current item is split while the indexscan is stopped and holds no read-lock on the page. The current item might move right onto a page that the indexscan holds no pin on. In the prior code this would allow btbulkdelete to reach and possibly delete the item, causing 'my bits moved right off the end of the world!' when the indexscan finally resumes. Fix by chaining read-locks to the right during _bt_restscan and requiring btbulkdelete to LockBufferForCleanup on every page it scans, not only those with deletable items. Per my pghackers message of 25-May-02. (Too bad no one could think of a better way.)
2002-10-20Rule rewriter was doing the wrong thing with conditional INSTEAD rulesTom Lane
whose conditions might yield NULL. The negated qual to attach to the original query is properly 'x IS NOT TRUE', not 'NOT x'. This fix produces correct behavior, but we may be taking a performance hit because the planner is much stupider about IS NOT TRUE than it is about NOT clauses. Future TODO: teach prepqual, other parts of planner how to cope with BooleanTest clauses more effectively.
2002-10-20Disallow aggregate functions in rule WHERE clauses. Per gripe fromTom Lane
Fritz Lehmann-Grube back in January.
2002-10-19Fix case where a function in FROM returns a scalar type, but isTom Lane
referred to with whole-tuple syntax.
2002-10-19Invert logic in pg_exec_query_string() so that we set a snapshot forTom Lane
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).
2002-10-19Fix rewrite code so that rules are in fact executed in order by name,Tom Lane
rather than being reordered according to INSTEAD attribute for implementation convenience. Also, increase compiled-in recursion depth limit from 10 to 100 rewrite cycles. 10 seems pretty marginal for situations where multiple rules exist for the same query. There was a complaint about this recently, so I'm going to bump it up. (Perhaps we should make the limit a GUC parameter, but that's too close to being a new feature to do in beta.)
2002-10-19Back out Alvaro's patch until regression tests pass.Bruce Momjian
2002-10-19Fix range-query estimation to not double-exclude NULLs, per gripe fromTom Lane
Ray Ontko 28-June-02. Also, fix prefix_selectivity for NAME lefthand variables (it was bogusly assuming binary compatibility), and adjust make_greater_string() to not call pg_mbcliplen() with invalid multibyte data (this last per bug report that I can't find at the moment, but it was in July '02).
2002-10-19Fix compile failure caused by new patch.Bruce Momjian
2002-10-19> Huh, I don't know where I got the idea you were (or someone else was?)Bruce Momjian
> 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
2002-10-19This patch adds some missing functions for float8 math operations,Bruce Momjian
specifically ceil(), floor(), and sign(). There may be other functions that need to be added, but this is a start. I've included some simple regression tests. Neil Conway
2002-10-19Add missing #include <errno.h>.Tom Lane
2002-10-18Improve formatting of --help output.Peter Eisentraut
2002-10-18Fix breakage that had crept into setlocale() usage: once again we'veTom Lane
been bit by the fact that the locale functions return pointers to modifiable variables. I added some comments that might help us avoid the mistake in future.
2002-10-15Fix Linux dynloader code for pre-HAVE_DLOPEN systems, which evidentlyTom Lane
are still in use out there. Per report from Brendan LeFebvre.
2002-10-14Make SPI's execution of querystrings follow the rules agreed to forTom Lane
command status at the interactive level. SPI_processed, etc are set in the same way as the returned command status would have been set if the same querystring were issued interactively. Per gripe from Michael Paesold 25-Sep-02.
2002-10-14Adjust handling of command status strings in the presence of rules,Tom Lane
as per recent pghackers discussions. initdb forced due to change in fields of stored Query nodes.
2002-10-14Translation updatesPeter Eisentraut
2002-10-14Arrange to copy relcache's trigdesc structure at the start of anyTom Lane
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.
2002-10-14As Niel so nicely pointed out this morning, the output of EXPLAINBruce Momjian
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
2002-10-13Make SET really not start a transaction.Tom Lane
2002-10-13Make macaddr_in reject trailing garbage (except whitespace).Tom Lane
Per gripe from Patrick Welche, 13-Oct-2002.