summaryrefslogtreecommitdiff
path: root/src/backend/commands
AgeCommit message (Collapse)Author
2001-05-30Remove OLD_FILE_NAMING code. No longer used.Bruce Momjian
2001-05-30These patches should fix check constraints not inheritingBruce Momjian
when added by alter table add constraint. The first file patches backend/commands/command.c and the latter is a patch to the alter table regression test. Stephan Szabo
2001-05-30Attached is my patch that adds DROP CONSTRAINT support to PostgreSQL. IBruce Momjian
basically want your guys feedback. I have sprinkled some of my q's thru the text delimited with the @@ symbol. It seems to work perfectly. [ Removed @@ comments because patch was reviewed. ] At the moment it does CHECK constraints only, with inheritance. However, due to the problem mentioned before with the mismatching between inherited constraints it may be wise to disable the inheritance feature for a while. it is written in an extensible fashion to support future dropping of other types of constraint, and is well documented. Please send me your comments, check my use of locking, updating of indices, use of ERROR and NOTICE, etc. and I will rework the patch based on feedback until everyone is happy with it... Christopher Kings
2001-05-27Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut
privileges. INSERT and COPY FROM now require INSERT (only). Add privileges regression test.
2001-05-25Oops, only wanted python change in the last commit. Backing out.Bruce Momjian
2001-05-25While changing Cygwin Python to build its core as a DLL (like Win32Bruce Momjian
Python) to support shared extension modules, I have learned that Guido prefers the style of the attached patch to solve the above problem. I feel that this solution is particularly appropriate in this case because the following: PglargeType PgType PgQueryType are already being handled in the way that I am proposing for PgSourceType. Jason Tishler
2001-05-21Enhancement of SPI to get access to portalsJan Wieck
- New functions to create a portal using a prepared/saved SPI plan or lookup an existing portal by name. - Functions to fetch/move from/in portals. Results are placed in the usual SPI_processed and SPI_tuptable, so the entire set of utility functions can be used to gain attribute access. - Prepared/saved SPI plans now use their own memory context and SPI_freeplan(plan) can remove them. - Tuple result sets (SPI_tuptable) now uses it's own memory context and can be free'd by SPI_freetuptable(tuptab). Enhancement of PL/pgSQL - Uses generic named portals internally in FOR ... SELECT loops to avoid running out of memory on huge result sets. - Support for CURSOR and REFCURSOR syntax using the new SPI functionality. Cursors used internally only need no explicit transaction block. Refcursor variables can be used inside of explicit transaction block to pass cursors between main application and functions. Jan
2001-05-18Small code cleanups,formatting.Bruce Momjian
2001-05-17Prevent forced blank line before comment block in pgindent.Bruce Momjian
2001-05-17Replace poorly-coded vac_find_eq routine with call to standard bsearchTom Lane
library code. Tweak progress messages to include elapsed real time, not only CPU time.
2001-05-14Remove unused tables pg_variable, pg_inheritproc, pg_ipl tables. InitdbBruce Momjian
forced.
2001-05-10Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt wasTom Lane
not being consulted anywhere, so remove it and remove the _mdnblocks() calls that were used to set it. Change smgrextend interface to pass in the target block number (ie, current file length) --- the caller always knows this already, having already done smgrnblocks(), so it's silly to do it over again inside mdextend. Net result: extension of a file now takes one lseek(SEEK_END) and a write(), not three lseeks and a write.
2001-05-09 This patch should catch cases where the typesBruce Momjian
in referencing and referenced columns of an fk constraint aren't comparable using '=' at constraint definition time rather than insert/update time. Stephan Szabo
2001-05-08Add SET SESSION AUTHORIZATION command.Peter Eisentraut
2001-05-07Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane
a separate statement (though it can still be invoked as part of VACUUM, too). pg_statistic redesigned to be more flexible about what statistics are stored. ANALYZE now collects a list of several of the most common values, not just one, plus a histogram (not just the min and max values). Random sampling is used to make the process reasonably fast even on very large tables. The number of values and histogram bins collected is now user-settable via an ALTER TABLE command. There is more still to do; the new stats are not being used everywhere they could be in the planner. But the remaining changes for this project should be localized, and the behavior is already better than before. A not-very-related change is that sorting now makes use of btree comparison routines if it can find one, rather than invoking '<' twice.
2001-04-04Have to lock buffer while changing page' LSN.Vadim B. Mikheev
Thanks to Tom.
2001-04-03Log sequence creation (to initialize magic number on recovery).Vadim B. Mikheev
2001-04-02Complain if the same column name is inherited from multiple parentsTom Lane
with different default values, unless the child table redeclares the column with an explicit default. This was judged to be the approach least likely to cause unpleasant surprises.
2001-03-30Re-allow specification of a new default value for an inherited columnTom Lane
in CREATE TABLE, but give a warning notice. Clean up inconsistent handling of defaults and NOT NULL flags from multiply-inherited columns. Per pghackers discussion 28-Mar through 30-Mar.
2001-03-29Rename 'random_seed' back to 'seed'.Peter Eisentraut
2001-03-25Fix unportable assumptions about alignment of local char[n] variables.Tom Lane
2001-03-23Fix comments that were mis-wrapped, for Tom Lane.Bruce Momjian
2001-03-22Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-03-14Reduce amount of memory used per tuple for after-event triggers. ThisTom Lane
is still a memory leak, but a little less bad than it was.
2001-03-14COPY should handle after-insert triggers the same as execMain.c does.Tom Lane
I'm not sure that it's really necessary to save insert events when there are only after update or delete triggers, but certainly it's wrong for COPY to behave differently from an INSERT query.
2001-03-14ifdef out reindex stuff in VACUUM for safety.Hiroshi Inoue
2001-03-12Avoid O(N^2) behavior in deferredTriggerAddEvent() for large numbers ofTom Lane
tuples inserted/deleted/updated in a single transaction. On my machine, this reduced the time to delete 80000 tuples in a foreign-key-referencing table from ~15min to ~8sec.
2001-03-07Repair a number of places that didn't bother to check whether PageAddItemTom Lane
succeeds or not. Revise rtree page split algorithm to take care about making a feasible split --- ie, will the incoming tuple actually fit? Failure to make a feasible split, combined with failure to notice the failure, account for Jim Stone's recent bug report. I suspect that hash and gist indices may have the same type of bug, but at least now we'll get error messages rather than silent failures if so. Also clean up rtree code to use Datum rather than char* where appropriate.
2001-02-27Tweak portal (cursor) code so that it will not call the executor againTom Lane
when user does another FETCH after reaching end of data, or another FETCH backwards after reaching start. This is needed because some plan nodes are not very robust about being called again after they've already returned NULL; for example, MergeJoin will crash in some states but not others. While the ideal approach would be for them all to handle this correctly, it seems foolish to assume that no such bugs would creep in again once cleaned up. Therefore, the most robust answer is to prevent the situation from arising at all.
2001-02-23Reindex of shared system indexes must be overwrite mode.Hiroshi Inoue
2001-02-16Clean up two rather nasty bugs in operator selection code.Tom Lane
1. If there is exactly one pg_operator entry of the right name and oprkind, oper() and related routines would return that entry whether its input type had anything to do with the request or not. This is just premature optimization: we shouldn't return the single candidate until after we verify that it really is a valid candidate, ie, is at least coercion-compatible with the given types. 2. oper() and related routines only promise a coercion-compatible result. Unfortunately, there were quite a few callers that assumed the returned operator is binary-compatible with the given datatype; they would proceed to call it without making any datatype coercions. These callers include sorting, grouping, aggregation, and VACUUM ANALYZE. In general I think it is appropriate for these callers to require an exact or binary-compatible match, so I've added a new routine compatible_oper() that only succeeds if it can find an operator that doesn't require any run-time conversions. Callers now call oper() or compatible_oper() depending on whether they are prepared to deal with type conversion or not. The upshot of these bugs is revealed by the following silliness in PL/Tcl's selftest: it creates an operator @< on int4, and then tries to use it to sort a char(N) column. The system would let it do that :-( (and evidently has done so since 6.3 :-( :-(). The result in this case was just a silly sort order, but the reverse combination would've provoked coredump from trying to dereference integers. With this fix you get more reasonable behavior: pltcl_test=# select * from T_pkey1 order by key1, key2 using @<; ERROR: Unable to identify an operator '@<' for types 'bpchar' and 'bpchar' You will have to retype this query using an explicit cast
2001-02-14Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane
clause with an alias is a <subquery> and therefore hides table references appearing within it, according to the spec. This is the same as the preliminary patch I posted to pgsql-patches yesterday, plus some really grotty code in ruleutils.c to reverse-list a query tree with the correct alias name depending on context. I'd rather not have done that, but unless we want to force another initdb for 7.1, there's no other way for now.
2001-02-13Added some comments to setval, setval_is_called and do_setvalPhilip Warner
2001-02-12Rearrange order of operations in heap_create_with_catalog so that ifTom Lane
two transactions create the same table name concurrently, the one that fails will complain about unique index pg_class_relname_index, rather than about pg_type_typname_index which'll confuse most people. Free side benefit: pg_class.reltype is correctly linked to the pg_type entry now. It's been zero in all but the preloaded pg_class entries since who knows when.
2001-01-29Clean up handling of tuple descriptors so that result-tuple descriptorsTom Lane
allocated by plan nodes are not leaked at end of query. This doesn't really matter for normal queries, but it sure does for queries invoked repetitively inside SQL functions. Clean up some other grotty code associated with tupdescs, and fix a few other memory leaks exposed by tests with simple SQL functions.
2001-01-27Looks like I broke cases involving combinations of deferred update/deleteTom Lane
triggers ... oops ... but the regress tests should have covered this ...
2001-01-27Suppress coredump when EXPLAINing query that is rewritten to includeTom Lane
a NOTIFY.
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-23Narrow scope of critical section, per discussion 1/19/01.Tom Lane
2001-01-23Fix all the places that called heap_update() and heap_delete() withoutTom Lane
bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
2001-01-23Rename int4 to int32 in a few places.Bruce Momjian
2001-01-22Clean up per-tuple memory leaks in trigger firing and plpgsqlTom Lane
expression evaluation.
2001-01-19Make critical sections (elog->crash) and interrupt holdoff sectionsTom Lane
into distinct concepts, per recent discussion on pghackers.
2001-01-19Suppress compiler warning in MULTIBYTE case.Tom Lane
2001-01-17Change lcons(x, NIL) to makeList(x) where appropriate.Bruce Momjian
2001-01-14Need to do BufferSync at end of DROP DATABASE as well as CREATE DATABASE.Tom Lane
Otherwise, newly connecting backends will still think the deleted DB is valid, and will generate unexpected error messages.
2001-01-14Restructure backend SIGINT/SIGTERM handling so that 'die' interruptsTom Lane
are treated more like 'cancel' interrupts: the signal handler sets a flag that is examined at well-defined spots, rather than trying to cope with an interrupt that might happen anywhere. See pghackers discussion of 1/12/01.
2001-01-12Add more critical-section calls: all code sections that hold spinlocksTom Lane
are now critical sections, so as to ensure die() won't interrupt us while we are munging shared-memory data structures. Avoid insecure intermediate states in some code that proc_exit will call, like palloc/pfree. Rename START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be what people tend to call them anyway, and make them be called with () like a function call, in hopes of not confusing pg_indent. I doubt that this is sufficient to make SIGTERM safe anywhere; there's just too much code that could get invoked during proc_exit().
2001-01-12Preserve constraints and column defaults during CLUSTER.Tom Lane
Wish they were all this easy ...