summaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
AgeCommit message (Collapse)Author
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-09-19Replace useless strcasecmp's by strcmp's.Peter Eisentraut
2001-08-16Sequences are now based on int8, not int4, arithmetic. SERIAL pseudo-typeTom Lane
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.)
2001-08-10Make OIDs optional, per discussions in pghackers. WITH OIDS is still theTom Lane
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.
2001-06-29Further work on connecting the free space map (which is still just aTom Lane
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.
2001-06-23Add TEMPORARY sequences and have SERIAL on a temp table have a temporaryBruce Momjian
sequence.
2001-06-13Fix compile failure when --enable-multibyte.Bruce Momjian
Marko Kreen
2001-06-06get_seq_name should truncate name to NAMEDATALEN, so that this works:Tom Lane
create sequence a1234567890123456789012345678901234567890; select nextval('a1234567890123456789012345678901234567890');
2001-06-01Check for malloc failure.Tom Lane
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-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-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-03-22pgindent run. Make it all clean.Bruce Momjian
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-13Added some comments to setval, setval_is_called and do_setvalPhilip Warner
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
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().
2000-12-28New WAL version - CRC and data blocks backup.Vadim B. Mikheev
2000-12-08Add missing copyright and RCS identification header.Tom Lane
2000-12-08Remove error check that disallowed setval() on a sequence with cacheTom Lane
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...
2000-12-03Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
2000-12-03Disable elog(ERROR|FATAL) in signal handlers inVadim B. Mikheev
critical sections of code.
2000-11-30XLOG stuff for sequences.Vadim B. Mikheev
CommitDelay in guc.c
2000-10-16Remove NO_SECURITY define.Bruce Momjian
2000-10-15Fix prototype declaration based on patch from David ReidPhilip Warner
2000-10-11Added new SQL function setval(seq,val,bool) to restore is_called as well as ↵Philip Warner
value (will be used in a future pg_dump).
2000-09-06Code cleanup of user name and user id handling in the backend. The currentPeter Eisentraut
user is now defined in terms of the user id, the user name is only computed upon request (for display purposes). This is kind of the opposite of the previous state, which would maintain the user name and compute the user id for permission checks. Besides perhaps saving a few cycles (integer vs string), this now creates a single point of attack for changing the user id during a connection, for purposes of "setuid" functions, etc.
2000-08-03More functions updated to new fmgr style --- money, name, tid datatypes.Tom Lane
We're reaching the mopup stage here (good thing too, this is getting tedious).
2000-07-05Update textin() and textout() to new fmgr style. This is just phaseTom Lane
one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit.
2000-06-14Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut
we'll get there one day. Use `cat' to create aclocal.m4, not `aclocal'. Some people don't have automake installed. Only run the autoconf rule in the top-level GNUmakefile if the invoker specified `make configure', don't run it automatically because of CVS timestamp skew.
2000-06-11Update sequence-related functions to new fmgr style. Remove downcasing,Tom Lane
quote-stripping, and acl-checking tasks for these functions from the parser, and do them at function execution time instead. This fixes the failure of pg_dump to produce correct output for nextval(Foo) used in a rule, and also eliminates the restriction that the argument of these functions must be a parse-time constant.
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-01-15Fixed all elog related warnings, as well as a few others.Peter Eisentraut
1999-12-31Revise init_sequence so that it doesn't leak memory if the requestedTom Lane
sequence doesn't exist.
1999-10-03Reimplement parsing and storage of default expressions and constraintTom Lane
expressions in CREATE TABLE. There is no longer an emasculated expression syntax for these things; it's full a_expr for constraints, and b_expr for defaults (unfortunately the fact that NOT NULL is a part of the column constraint syntax causes a shift/reduce conflict if you try a_expr. Oh well --- at least parenthesized boolean expressions work now). Also, stored expression for a column default is not pre-coerced to the column type; we rely on transformInsertStatement to do that when the default is actually used. This means "f1 datetime default 'now'" behaves the way people usually expect it to. BTW, all the support code is now there to implement ALTER TABLE ADD CONSTRAINT and ALTER TABLE ADD COLUMN with a default value. I didn't actually teach ALTER TABLE to call it, but it wouldn't be much work.
1999-09-18Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane
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.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-16Final cleanup.Bruce Momjian
1999-07-15Change #include's to use <> and "" as appropriate.Bruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-02-13Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian
1998-12-15Initial MVCC code.Vadim B. Mikheev
New code for locking buffer' context.
1998-11-27New HeapTuple structure/interface.Vadim B. Mikheev
1998-09-01OK, folks, here is the pgindent output.Bruce Momjian
1998-09-01Renaming cleanup, no pgindent yet.Bruce Momjian
1998-08-25From: Massimo Dal Zotto <dz@cs.unitn.it>Marc G. Fournier
> sequence.patch > > adds the missing setval command to sequences. Owner of sequences > can now set the last value to any value between min and max > without recreating the sequence. This is useful after loading > data from external files.
1998-08-19heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian
no longer returns buffer pointer, can be gotten from scan; descriptor; bootstrap can create multi-key indexes; pg_procname index now is multi-key index; oidint2, oidint4, oidname are gone (must be removed from regression tests); use System Cache rather than sequential scan in many places; heap_modifytuple no longer takes buffer parameter; remove unused buffer parameter in a few other functions; oid8 is not index-able; remove some use of single-character variable names; cleanup Buffer variables usage and scan descriptor looping; cleaned up allocation and freeing of tuples; 18k lines of diff;
1998-08-06Make large objects their own relkind type. Fix dups in pg_class_mbBruce Momjian
files. Fix sequence creation hack for relkind type.