aboutsummaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAge
* Remove incorrect 'Assert(targetList != NULL)'. AnTom Lane1999-09-19
| | | | | INSERT ... DEFAULT VALUES statement does indeed have a null targetlist, at least during parse and rewrite stages.
* Fix CASE bug identified by Keith Parks: CASE didn't reliablyTom Lane1999-09-18
| | | | | treat a NULL condition result as FALSE. Clean up some bogus comments here and there, too.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-18
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Changes made by Hiroshi Inoue and approved by Vadim.Tatsuo Ishii1999-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See attached mail for more details. ------------------------------------------------------------------- From: "Vadim Mikheev" <vadim@krs.ru> To: "Hiroshi Inoue" <Inoue@tpf.co.jp> References: <000201befa94$42fe04c0$2801007e@cadzone.tpf.co.jp> Subject: Re: elog(ERROR) in vacuum Date: Fri, 10 Sep 1999 10:27:10 +0900 Organization: OJSC Rostelecom (Krasnoyarsk) Message-ID: <37D85E6E.5AFA126D@krs.ru> Hiroshi Inoue wrote: > > Hello Vadim, > > I have a question about vacuum. > > VACUUM has a phase like commit which calls TransactionIdCommit(). > But if elog(ERROR) occured after that,the status of transaction is > changed from XID_COMMIT to XID_ABORT. > > Seems to me this causes inconsistency. > Shoudn't AbortTransaction() be changed not to call TransacionIdAbort() > in case of vacuum. You're right! As usual -:) Vadim
* Allow ISOLATION and LEVEL as column names. These are SQL92 reserved wordsThomas G. Lockhart1999-09-14
| | | | which do not need to be so for our parser. Apparently omitted earlier.
* Allow CASE statement to contain *only* untyped result clauses or nulls.Thomas G. Lockhart1999-09-13
| | | | | | | Almost worked before, but forgot one place to check. Reported by Tatsuo Ishii. Still does not do the right thing if inserting into a non-string target column. Should look for a type coersion later, but doesn't.
* First cut at doing something reasonable with OR-of-ANDs WHERETom Lane1999-09-13
| | | | | | | | conditions. There are some pretty bogus heuristics in prepqual.c that try to decide whether to output CNF or DNF format; they need to be replaced, likely. Right now the code is probably too willing to choose DNF form, which might hurt performance in some cases that used to work OK. But at least we have a foundation to build on.
* cygwin doesn't have an endian.h, but defines BYTE_ORDER in sys/param.hMarc G. Fournier1999-09-12
|
* Further improvements in cnfify: reduce amount of self-recursionTom Lane1999-09-12
| | | | | | | | | in or_normalize, remove detection of duplicate subexpressions (since it's highly unlikely to be worth the amount of time it takes), and introduce a dnfify() entry point so that unintelligible backwards logic in UNION processing can be eliminated. This is just an intermediate step --- next thing is to look at not forcing the qual into CNF form when it would be better off in DNF form.
* Eliminate query length limitation imposed by pg_client_to_serverTom Lane1999-09-11
| | | | | and pg_server_to_client. Eliminate copy.c's restriction on the length of a single attribute.
* Eliminate token length assumption in scanstr().Tom Lane1999-09-11
|
* Eliminate elog()'s hardwired limit on length of an error message.Tom Lane1999-09-11
| | | | | | | | | This change seems necessary in conjunction with long queries, and it cleans up some bogosity in connection with long EXPLAIN texts anyway. Note that current libpq will accept any length error message (at least until it runs out of memory); prior versions have a limit of 8K, but will cleanly discard excess error text, so there shouldn't be any big compatibility problems with old clients.
* Repair incorrect cleanup of heap memory allocation duringTom Lane1999-09-09
| | | | | | transaction abort --- before it only worked if there was exactly one level of allocation context stacked in the blank portal. Now it does the right thing for any depth, including zero...
* Minor improvement in SI overflow logic: try to deleteTom Lane1999-09-09
| | | | expired messages before concluding that we really have buffer overflow.
* Get rid of elog(DEBUG) in snprintf emulation ... it's justTom Lane1999-09-09
| | | | cluttering the log file...
* Repair error noticed by Roberto Cornacchia: selectivity codeTom Lane1999-09-09
| | | | | | | | was rejecting negative attnums as bogus, which of course they are not. Add code to get_attdisbursion to produce a useful value for OID attribute, since VACUUM does not store stats for system attributes. Also, repair bug that's been in eqjoinsel for a long time: it was taking the max of the two columns' disbursions, whereas it should use the min.
* StreamConnection() mustn't call elog().Tom Lane1999-09-08
|
* Cope with versions of vsnprintf() written by people whoTom Lane1999-09-08
| | | | don't read man pages...
* Repair logic error in LIKE: should not return LIKE_ABORTTom Lane1999-09-07
| | | | when reach end of pattern before end of text. Improve code comments.
* Performance improvements in cnfify(): get rid of exponentialTom Lane1999-09-07
| | | | | | | | space consumption in pull_args, and avoid doing the full CNF transform on operands of operator clauses, where it's really not particularly helpful. This answers the TODO item about large numbers of OR clauses, at least partially. I was able to do a ten-thousand-OR-clause query with about 20Mb memory consumption ... it took an obscenely long time, but it worked...
* Mike Ansley's fixes for long queries. This change justTom Lane1999-09-07
| | | | | | | corrects flex myinput() routine so that it doesn't assume there is only one bufferload of data. We still have the issue of getting rid of YY_USES_REJECT so that the scanner can cope with tokens larger than its initial buffer size.
* I finally understood what sinvaladt.c is doing --- and itTom Lane1999-09-06
| | | | | | offended my aesthestic sensibility that there was so much unreadable code doing so little. Rewritten code is about half the size, faster, and (I hope) much more intelligible.
* Fix relcache.c so that local relations (those created duringTom Lane1999-09-06
| | | | | | | current transaction) are not flushed by shared-cache-inval reset message. SI reset actually works now, for probably the first time in a long time. I was able to run initdb and regression tests with a 16-element SI message array, with a lot of NOTICE: cache state reset messages but no crashes.
* RelationCacheInvalidate thought there were 7 nailed-in-cacheTom Lane1999-09-06
| | | | | system tables, but actually there are only 6 --- see RelationInitialize. Kinda makes you wonder how long ago this code was last executed...
* Per Tatsuo's recommendation, change mdopen so that it won'tTom Lane1999-09-05
| | | | | automatically create the file, except during bootstrap mode where that seems to be necessary.
* Disallow DROP TABLE/DROP INDEX inside a transaction block.Tom Lane1999-09-05
| | | | | | | | | | We can't support these properly, since once the relation's physical files are unlinked, there's no way to roll back the transaction. I suppose we could postpone the unlink till transaction commit, but then what of BEGIN; DROP TABLE foo; CREATE TABLE foo; ? The code does allow dropping a table/index created in the current transaction block, however, since the post-abort state would be that the table doesn't exist anyway.
* IsTransactionBlock() should return true in TBLOCK_ABORT state.Tom Lane1999-09-05
|
* remove elogs used for debugging.Bruce Momjian1999-09-04
|
* Intercept temp table lookups further up to map temp names.Bruce Momjian1999-09-04
|
* In RelationNameGetRelation(), replace temp table name byTom Lane1999-09-04
| | | | | | real name before doing lookup. We only want to index temp tables by their real names in the relcache, to ensure there's not more than one relcache entry for them.
* Avoid transaction overhead when there are no temp tablesTom Lane1999-09-04
| | | | to be deleted.
* Remove no-longer-needed code to update temprel's copy ofTom Lane1999-09-04
| | | | pg_class tuple during ALTER TABLE ADD COLUMN.
* Invalidate temp entries for aborted transactions.Bruce Momjian1999-09-04
|
* Modify RelationFlushRelation so that if the relcache entryTom Lane1999-09-04
| | | | | | | | | | | has positive refcount, it is rebuilt from pg_class data. This ensures that relcache entries will track changes made by other backends. Formerly, a shared inval report would just be ignored if it happened to arrive while the relcache entry was in use. Also, fix relcache to reset ref counts to zero during transaction abort. Finally, change LockRelation() so that it checks for shared inval reports after obtaining the lock. In this way, once any kind of lock has been obtained on a rel, we can trust the relcache entry to be up-to-date.
* Modify sinval so that InvalidateSharedInvalid() does not holdTom Lane1999-09-04
| | | | | | | | the SInval spinlock while it is calling the passed invalFunction or resetFunction. This is necessary to avoid deadlock with lmgr change; InvalidateSharedInvalid can be called recursively now. It should be a good performance improvement anyway --- holding a spinlock for more than a very short interval is a no-no.
* Rule deparser didn't handle unary operators correctly.Tom Lane1999-09-02
|
* Repair a bunch of problems in md.c. This builds on Hiroshi'sTom Lane1999-09-02
| | | | | | | | | | | | | | | | | | | insight that RelationFlushRelation ought to invoke smgrclose, and that the way to make that work is to ensure that mdclose doesn't fail if the relation is already closed (or unlinked, if we are looking at a DROP TABLE). While I was testing that, I was able to identify several problems that we had with multiple-segment relations. The system is now able to do initdb and pass the regression tests with a very small segment size (I had it set to 64Kb per segment for testing). I don't believe that ever worked before. File descriptor leaks seem to be gone too. I have partially addressed the concerns we had about mdtruncate(), too. On a Win32 or NFS filesystem it is not possible to unlink a file that another backend is holding open, so what md.c now does is to truncate unwanted files to zero length before trying to unlink them. The other backends will be forced to close their open files by relation cache invalidation --- but I think it would take considerable work to make that happen before vacuum truncates the relation rather than after. Leaving zero-length files lying around seems a usable compromise.
* Commit the bulk of Mike Ansley's long-query changes in theTom Lane1999-08-31
| | | | backend. Still much left to do.
* Minor improvements to stringinfo package to make it moreTom Lane1999-08-31
| | | | robust, since it's about to get used much more heavily.
* Fix several problems in rule deparsing: didn't handle arrayTom Lane1999-08-28
| | | | | | | references or CASE expressions, didn't parenthesize complex expressions properly. Also, always output variable references as fully qualified names to eliminate ambiguity bug recently reported. (This could be smarter, but reliability comes first.)
* Clean up some mistakes in handling of uplevel Vars in planner.Tom Lane1999-08-26
| | | | | | | Most parts of the planner should ignore, or indeed never even see, uplevel Vars because they will be or have been replaced by Params. There were a couple of places that got it wrong though, probably my fault from recent changes...
* Clean up some bugs in oper_select_candidate(), notably theTom Lane1999-08-26
| | | | | | last loop which would return the *first* surviving-to-that-point candidate regardless of which one actually passed the test. This was producing such curious results as 'oid % 2' getting translated to 'int2(oid) % 2'.
* Revise implementation of SubLinks so that there is a consistent,Tom Lane1999-08-25
| | | | | | | | | documented intepretation of the lefthand and oper fields. Fix a number of obscure problems while at it --- for example, the old code failed if the parser decided to insert a type-coercion function just below the operator of a SubLink. CAUTION: this will break stored rules that contain subplans. You may need to initdb.
* Fix vacuum's memory consumptionTatsuo Ishii1999-08-25
|
* Alter AllocSet routines so that requests larger thanTom Lane1999-08-24
| | | | | | | | | | ALLOC_BIGCHUNK_LIMIT are always allocated as separate malloc() blocks, and are free()d immediately upon pfree(). Also, if such a chunk is enlarged with repalloc(), translate the operation into a realloc() so as to minimize memory usage. Of course, these large chunks still get freed automatically if the alloc set is reset. I have set ALLOC_BIGCHUNK_LIMIT at 64K for now, but perhaps another size would be better?
* coerce_type() failed to guard against trying to convert a NULLTom Lane1999-08-24
| | | | | constant to a different type. Not sure that this could happen in ordinary parser usage, but it can in some new code I'm working on...
* Remove bogus code in oper_exact --- if it didn't find an exactTom Lane1999-08-23
| | | | | | | | | match then it tried for a self-commutative operator with the reversed input data types. This is pretty silly; there could never be such an operator, except maybe in binary-compatible-type scenarios, and we have oper_inexact for that. Besides which, the oprsanity regress test would complain about such an operator. Remove nonfunctional code and simplify routine calling convention accordingly.
* Further sort-order twiddling in optimizer: be smart aboutTom Lane1999-08-22
| | | | case where ORDER BY and GROUP BY request the same sort order.
* Further planner/optimizer cleanups. Move all set_tlist_referencesTom Lane1999-08-22
| | | | | | | | | | and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
* Major revision of sort-node handling: push knowledge of queryTom Lane1999-08-21
| | | | | | | | | | | | | sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb.