aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
Commit message (Collapse)AuthorAge
* 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.
* pgindent run.Bruce Momjian2002-09-04
|
* Workaround for format strings that are concatenated from macrosPeter Eisentraut2002-09-03
| | | | (INT64_FORMAT), which gettext cannot handle.
* Add attisinherited column to pg_attribute; use it to guard againstTom Lane2002-08-30
| | | | | | column additions, deletions, and renames that would let a child table get out of sync with its parent. Patch by Alvaro Herrera, with some kibitzing by Tom Lane.
* Restructure local-buffer handling per recent pghackers discussion.Tom Lane2002-08-06
| | | | | | | | | | | | | | The local buffer manager is no longer used for newly-created relations (unless they are TEMP); a new non-TEMP relation goes through the shared bufmgr and thus will participate normally in checkpoints. But TEMP relations use the local buffer manager throughout their lifespan. Also, operations in TEMP relations are not logged in WAL, thus improving performance. Since it's no longer necessary to fsync relations as they move out of the local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code is no longer needed and has been removed: there's no concept of a dirty relation anymore in md.c/fd.c, and we never fsync anything but WAL. Still TODO: improve local buffer management algorithms so that it would be reasonable to increase NLocBuffer.
* Add more dependency insertions --- this completes the basic pg_dependTom Lane2002-07-16
| | | | | functionality. Of note: dropping a table that has a SERIAL column defined now drops the associated sequence automatically.
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* WriteBuffer return value:Bruce Momjian2002-06-15
| | | | | | | >I'd vote for changing WriteBuffer to >return void, and have it elog() on bad argument. Manfred Koizar
* This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax inBruce Momjian2002-06-15
| | | | | | | | | | | HeapTupleHeaderData in setter and getter macros called HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc. It also introduces a "virtual" field xvac by defining HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac. Xvac is used by VACUUM, in fact it is stored in t_cmin. Manfred Koizar
* Modify sequence state storage to eliminate dangling-pointer problemTom Lane2002-05-22
| | | | | | | | exemplified by bug #671. Moving the storage to relcache turned out to be a bad idea because relcache might decide to discard the info. Instead, open and close the relcache entry on each sequence operation, and use a record of the current XID to discover whether we already hold AccessShareLock on the sequence.
* Remove global variable scanCommandId in favor of storing a command IDTom Lane2002-05-21
| | | | | | | | | | | in snapshots, per my proposal of a few days ago. Also, tweak heapam.c routines (heap_insert, heap_update, heap_delete, heap_mark4update) to be passed the command ID to use, instead of doing GetCurrentCommandID. For catalog updates they'll still get passed current command ID, but for updates generated from the main executor they'll get passed the command ID saved in the snapshot the query is using. This should fix some corner cases associated with functions and triggers that advance current command ID while an outer query is still in progress.
* The contents of command.c, creatinh.c, define.c, remove.c and rename.cTom Lane2002-04-15
| | | | | | | | | | | | | | | have been divided according to the type of object manipulated - so ALTER TABLE code is in tablecmds.c, aggregate commands in aggregatecmds.c and so on. A few common support routines remain in define.c (prototypes in src/include/commands/defrem.h). No code has been changed except for includes to reflect the new files. The prototypes for aggregatecmds.c, functioncmds.c, operatorcmds.c, and typecmds.c remain in src/include/commands/defrem.h. From John Gray <jgray@azuli.co.uk>
* Further cleanups for relations in schemas: teach nextval and otherTom Lane2002-03-30
| | | | | | sequence functions how to cope with qualified names. Same code is also used for int4notin, currtid_byrelname, pgstattuple. Also, move TOAST tables into special pg_toast namespace.
* pg_type has a typnamespace column; system now supports creating typesTom Lane2002-03-29
| | | | | | in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
* A little further progress on schemas: push down RangeVars intoTom Lane2002-03-22
| | | | | | | addRangeTableEntry calls. Remove relname field from RTEs, since it will no longer be a useful unique identifier of relations; we want to encourage people to rely on the relation OID instead. Further work on dumping qual expressions in EXPLAIN, too.
* Change the aclchk.c routines to uniformly use OIDs to identify theTom Lane2002-03-21
| | | | | | objects to be privilege-checked. Some change in their APIs would be necessary no matter what in the schema environment, and simply getting rid of the name-based interface entirely seems like the best way.
* First phase of SCHEMA changes, concentrating on fixing the grammar andTom Lane2002-03-21
| | | | | | | | the parsetree representation. As yet we don't *do* anything with schema names, just drop 'em on the floor; but you can enter schema-compatible command syntax, and there's even a primitive CREATE SCHEMA command. No doc updates yet, except to note that you can now extract a field from a function-returning-row's result with (foo(...)).fieldname.
* Repair two problems with WAL logging of sequence nextvalI() ops, asTom Lane2002-03-15
| | | | | | per recent pghackers discussion: force a new WAL record at first nextval after a checkpoint, and ensure that xlog is flushed to disk if a nextval record is the only thing emitted by a transaction.
* Change made to elog:Bruce Momjian2002-03-06
| | | | | | | | | | | | | | | | | | | o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
* Fix sequence creation to set the t_xmin of a sequence's tuple toTom Lane2002-01-11
| | | | | | | | | | | | FrozenTransactionId, not the XID of the creating transaction. Without this it's possible for a reference to a long-gone CLOG record to occur, per Christian Meunier's bug report of 10-Jan-02. Worse, the sequence tuple would become invisible to SELECTs after 2 billion transactions. Since the fix is applied during sequence creation it does not help existing databases, unless you drop and recreate every sequence. However, we intend to force initdb for 7.2RC1 anyway, to fix a pg_proc error, so I see no need to do more for this problem.
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-28
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Replace useless strcasecmp's by strcmp's.Peter Eisentraut2001-09-19
|
* Sequences are now based on int8, not int4, arithmetic. SERIAL pseudo-typeTom Lane2001-08-16
| | | | | | | | has an alias SERIAL4 and a sister SERIAL8. SERIAL8 is just the same except the created column is type int8 not int4. initdb forced. Note this also breaks any chance of pg_upgrade from 7.1, unless we hack up pg_upgrade to drop and recreate sequences. (Which is not out of the question, but I don't wanna do it.)
* Make OIDs optional, per discussions in pghackers. WITH OIDS is still theTom Lane2001-08-10
| | | | | | | | | | | | default, but OIDS are removed from many system catalogs that don't need them. Some interesting side effects: TOAST pointers are 20 bytes not 32 now; pg_description has a three-column key instead of one. Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey has some usefulness; pg_dump dumps comments on indexes, rules, and triggers in a valid order. initdb forced.
* Further work on connecting the free space map (which is still just aTom Lane2001-06-29
| | | | | | | | stub) into the rest of the system. Adopt a cleaner approach to preventing deadlock in concurrent heap_updates: allow RelationGetBufferForTuple to select any page of the rel, and put the onus on it to lock both buffers in a consistent order. Remove no-longer-needed isExtend hack from API of ReleaseAndReadBuffer.
* Add TEMPORARY sequences and have SERIAL on a temp table have a temporaryBruce Momjian2001-06-23
| | | | sequence.
* Fix compile failure when --enable-multibyte.Bruce Momjian2001-06-13
| | | | Marko Kreen
* get_seq_name should truncate name to NAMEDATALEN, so that this works:Tom Lane2001-06-06
| | | | | create sequence a1234567890123456789012345678901234567890; select nextval('a1234567890123456789012345678901234567890');
* Check for malloc failure.Tom Lane2001-06-01
|
* Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut2001-05-27
| | | | | privileges. INSERT and COPY FROM now require INSERT (only). Add privileges regression test.
* Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt wasTom Lane2001-05-10
| | | | | | | | | 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.
* Have to lock buffer while changing page' LSN.Vadim B. Mikheev2001-04-04
| | | | Thanks to Tom.
* Log sequence creation (to initialize magic number on recovery).Vadim B. Mikheev2001-04-03
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Repair a number of places that didn't bother to check whether PageAddItemTom Lane2001-03-07
| | | | | | | | | | 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.
* Added some comments to setval, setval_is_called and do_setvalPhilip Warner2001-02-13
|
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Add more critical-section calls: all code sections that hold spinlocksTom Lane2001-01-12
| | | | | | | | | | | 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().
* New WAL version - CRC and data blocks backup.Vadim B. Mikheev2000-12-28
|
* Add missing copyright and RCS identification header.Tom Lane2000-12-08
|
* Remove error check that disallowed setval() on a sequence with cacheTom Lane2000-12-08
| | | | | | | | | value greater than one. The behavior this sought to disallow doesn't seem any less confusing than the other behaviors of cached sequences. Improve wording of some error messages, too. Update documentation accordingly. Also add an explanation that aborted transactions do not roll back their nextval() calls; this seems to be a FAQ, so it ought to be mentioned here...
* Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane2000-12-03
| | | | | values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
* Disable elog(ERROR|FATAL) in signal handlers inVadim B. Mikheev2000-12-03
| | | | critical sections of code.
* XLOG stuff for sequences.Vadim B. Mikheev2000-11-30
| | | | CommitDelay in guc.c
* Remove NO_SECURITY define.Bruce Momjian2000-10-16
|
* Fix prototype declaration based on patch from David ReidPhilip Warner2000-10-15
|
* Added new SQL function setval(seq,val,bool) to restore is_called as well as ↵Philip Warner2000-10-11
| | | | | | value (will be used in a future pg_dump).