summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/lockfuncs.c
AgeCommit message (Collapse)Author
2017-06-27Merge PG10 master branch into xl10develPavan Deolasee
This commit merges PG10 branch upto commit 2710ccd782d0308a3fa1ab193531183148e9b626. Regression tests show no noteworthy additional failures. This merge includes major pgindent work done with the newer version of pgindent
2017-06-21Phase 3 of pgindent updates.Tom Lane
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]
2017-06-14Merge from PG master upto d5cb3bab564e0927ffac7c8729eacf181a12dd40Pavan Deolasee
This is the result of the "git merge remotes/PGSQL/master" upto the said commit point. We have done some basic analysis, fixed compilation problems etc, but bulk of the logical problems in conflict resolution etc will be handled by subsequent commits.
2017-04-10Move isolationtester's is-blocked query into C code for speed.Tom Lane
Commit 4deb41381 modified isolationtester's query to see whether a session is blocked to also check for waits occurring in GetSafeSnapshot. However, it did that in a way that enormously increased the query's runtime under CLOBBER_CACHE_ALWAYS, causing the buildfarm members that use that to run about four times slower than before, and in some cases fail entirely. To fix, push the entire logic into a dedicated backend function. This should actually reduce the CLOBBER_CACHE_ALWAYS runtime from what it was previously, though I've not checked that. In passing, expose a SQL function to check for safe-snapshot blockage, comparable to pg_blocking_pids. This is more or less free given the infrastructure built to solve the other problem, so we might as well. Thomas Munro Discussion: https://postgr.es/m/[email protected]
2017-01-03Update copyright via script for 2017Bruce Momjian
2016-10-27Merge commit 'b5bce6c1ec6061c8a4f730d927e162db7e2ce365'Pavan Deolasee
2016-03-10Provide much better wait information in pg_stat_activity.Robert Haas
When a process is waiting for a heavyweight lock, we will now indicate the type of heavyweight lock for which it is waiting. Also, you can now see when a process is waiting for a lightweight lock - in which case we will indicate the individual lock name or the tranche, as appropriate - or for a buffer pin. Amit Kapila, Ildus Kurbangaliev, reviewed by me. Lots of helpful discussion and suggestions by many others, including Alexander Korotkov, Vladimir Borodin, and many others.
2016-02-22Create a function to reliably identify which sessions block which others.Tom Lane
This patch introduces "pg_blocking_pids(int) returns int[]", which returns the PIDs of any sessions that are blocking the session with the given PID. Historically people have obtained such information using a self-join on the pg_locks view, but it's unreasonably tedious to do it that way with any modicum of correctness, and the addition of parallel queries has pretty much broken that approach altogether. (Given some more columns in the view than there are today, you could imagine handling parallel-query cases with a 4-way join; but ugh.) The new function has the following behaviors that are painful or impossible to get right via pg_locks: 1. Correctly understands which lock modes block which other ones. 2. In soft-block situations (two processes both waiting for conflicting lock modes), only the one that's in front in the wait queue is reported to block the other. 3. In parallel-query cases, reports all sessions blocking any member of the given PID's lock group, and reports a session by naming its leader process's PID, which will be the pg_backend_pid() value visible to clients. The motivation for doing this right now is mostly to fix the isolation tests. Commit 38f8bdcac4982215beb9f65a19debecaf22fd470 lobotomized isolationtester's is-it-waiting query by removing its ability to recognize nonconflicting lock modes, as a crude workaround for the inability to handle soft-block situations properly. But even without the lock mode tests, the old query was excessively slow, particularly in CLOBBER_CACHE_ALWAYS builds; some of our buildfarm animals fail the new deadlock-hard test because the deadlock timeout elapses before they can probe the waiting status of all eight sessions. Replacing the pg_locks self-join with use of pg_blocking_pids() is not only much more correct, but a lot faster: I measure it at about 9X faster in a typical dev build with Asserts, and 3X faster in CLOBBER_CACHE_ALWAYS builds. That should provide enough headroom for the slower CLOBBER_CACHE_ALWAYS animals to pass the test, without having to lengthen deadlock_timeout yet more and thus slow down the test for everyone else.
2016-01-02Update copyright for 2016Bruce Momjian
Backpatch certain files through 9.1
2015-06-05Merge remote-tracking branch 'remotes/PGSQL/master' into XL_NEW_MASTERPavan Deolasee
Conflicts: .gitignore contrib/Makefile src/backend/access/common/heaptuple.c src/backend/access/transam/rmgr.c src/backend/access/transam/xact.c src/backend/catalog/Makefile src/backend/catalog/catalog.c src/backend/catalog/genbki.pl src/backend/catalog/namespace.c src/backend/commands/sequence.c src/backend/executor/execMain.c src/backend/executor/functions.c src/backend/executor/nodeAgg.c src/backend/executor/nodeModifyTable.c src/backend/nodes/copyfuncs.c src/backend/nodes/outfuncs.c src/backend/nodes/readfuncs.c src/backend/optimizer/plan/createplan.c src/backend/optimizer/plan/planner.c src/backend/optimizer/plan/setrefs.c src/backend/optimizer/util/pathnode.c src/backend/parser/gram.y src/backend/parser/parse_agg.c src/backend/parser/parse_utilcmd.c src/backend/postmaster/postmaster.c src/backend/replication/logical/decode.c src/backend/storage/file/fd.c src/backend/storage/ipc/procsignal.c src/backend/tcop/utility.c src/backend/utils/adt/lockfuncs.c src/backend/utils/adt/ruleutils.c src/backend/utils/sort/tuplesort.c src/backend/utils/time/snapmgr.c src/include/access/rmgrlist.h src/include/catalog/pg_aggregate.h src/include/catalog/pg_proc.h src/include/nodes/execnodes.h src/include/nodes/plannodes.h src/include/nodes/primnodes.h src/include/nodes/relation.h src/include/storage/lwlock.h src/include/storage/procsignal.h src/include/utils/plancache.h src/include/utils/snapshot.h src/test/regress/expected/foreign_key.out src/test/regress/expected/triggers.out src/test/regress/expected/with.out src/test/regress/input/constraints.source src/test/regress/output/constraints.source src/test/regress/pg_regress.c src/test/regress/serial_schedule src/test/regress/sql/returning.sql
2015-06-04Merge remote-tracking branch 'remotes/PGSQL/master' into XL_NEW_MASTERPavan Deolasee
Conflicts: COPYRIGHT configure configure.in contrib/Makefile doc/bug.template src/backend/access/common/heaptuple.c src/backend/access/common/printtup.c src/backend/access/transam/Makefile src/backend/access/transam/clog.c src/backend/access/transam/twophase.c src/backend/access/transam/varsup.c src/backend/access/transam/xact.c src/backend/access/transam/xlog.c src/backend/bootstrap/bootstrap.c src/backend/catalog/Makefile src/backend/catalog/catalog.c src/backend/catalog/dependency.c src/backend/catalog/genbki.pl src/backend/catalog/namespace.c src/backend/catalog/pg_aggregate.c src/backend/catalog/pg_proc.c src/backend/catalog/storage.c src/backend/commands/aggregatecmds.c src/backend/commands/analyze.c src/backend/commands/comment.c src/backend/commands/copy.c src/backend/commands/dbcommands.c src/backend/commands/event_trigger.c src/backend/commands/explain.c src/backend/commands/indexcmds.c src/backend/commands/portalcmds.c src/backend/commands/schemacmds.c src/backend/commands/sequence.c src/backend/commands/tablecmds.c src/backend/commands/trigger.c src/backend/commands/vacuum.c src/backend/commands/variable.c src/backend/commands/view.c src/backend/executor/execAmi.c src/backend/executor/execCurrent.c src/backend/executor/execMain.c src/backend/executor/execProcnode.c src/backend/executor/execTuples.c src/backend/executor/execUtils.c src/backend/executor/nodeAgg.c src/backend/executor/nodeModifyTable.c src/backend/executor/nodeSubplan.c src/backend/executor/nodeWindowAgg.c src/backend/libpq/hba.c src/backend/nodes/copyfuncs.c src/backend/nodes/equalfuncs.c src/backend/nodes/outfuncs.c src/backend/nodes/readfuncs.c src/backend/optimizer/path/allpaths.c src/backend/optimizer/path/costsize.c src/backend/optimizer/plan/createplan.c src/backend/optimizer/plan/planagg.c src/backend/optimizer/plan/planner.c src/backend/optimizer/plan/setrefs.c src/backend/optimizer/plan/subselect.c src/backend/optimizer/prep/preptlist.c src/backend/optimizer/prep/prepunion.c src/backend/optimizer/util/pathnode.c src/backend/optimizer/util/plancat.c src/backend/parser/analyze.c src/backend/parser/gram.y src/backend/parser/parse_agg.c src/backend/parser/parse_relation.c src/backend/parser/parse_utilcmd.c src/backend/postmaster/autovacuum.c src/backend/postmaster/pgstat.c src/backend/postmaster/postmaster.c src/backend/replication/logical/decode.c src/backend/storage/buffer/bufmgr.c src/backend/storage/ipc/ipci.c src/backend/storage/ipc/procarray.c src/backend/storage/ipc/procsignal.c src/backend/storage/lmgr/lock.c src/backend/storage/lmgr/lwlock.c src/backend/storage/lmgr/proc.c src/backend/tcop/dest.c src/backend/tcop/postgres.c src/backend/tcop/pquery.c src/backend/tcop/utility.c src/backend/utils/adt/arrayfuncs.c src/backend/utils/adt/date.c src/backend/utils/adt/dbsize.c src/backend/utils/adt/pseudotypes.c src/backend/utils/adt/ri_triggers.c src/backend/utils/adt/ruleutils.c src/backend/utils/adt/version.c src/backend/utils/cache/inval.c src/backend/utils/cache/lsyscache.c src/backend/utils/cache/plancache.c src/backend/utils/cache/relcache.c src/backend/utils/init/globals.c src/backend/utils/init/miscinit.c src/backend/utils/init/postinit.c src/backend/utils/misc/guc.c src/backend/utils/mmgr/portalmem.c src/backend/utils/sort/tuplesort.c src/backend/utils/sort/tuplestore.c src/backend/utils/time/combocid.c src/backend/utils/time/snapmgr.c src/bin/Makefile src/bin/initdb/initdb.c src/bin/pg_ctl/pg_ctl.c src/bin/pg_dump/pg_dump.c src/bin/pgbench/pgbench.c src/bin/psql/tab-complete.c src/include/access/htup.h src/include/access/rmgrlist.h src/include/access/transam.h src/include/access/xact.h src/include/catalog/catalog.h src/include/catalog/namespace.h src/include/catalog/pg_aggregate.h src/include/catalog/pg_namespace.h src/include/catalog/pg_proc.h src/include/catalog/pg_type.h src/include/commands/explain.h src/include/commands/sequence.h src/include/commands/vacuum.h src/include/commands/variable.h src/include/executor/execdesc.h src/include/executor/executor.h src/include/executor/tuptable.h src/include/miscadmin.h src/include/nodes/execnodes.h src/include/nodes/nodes.h src/include/nodes/params.h src/include/nodes/parsenodes.h src/include/nodes/plannodes.h src/include/nodes/primnodes.h src/include/nodes/relation.h src/include/optimizer/cost.h src/include/optimizer/pathnode.h src/include/optimizer/planmain.h src/include/parser/analyze.h src/include/parser/parse_agg.h src/include/parser/parse_utilcmd.h src/include/pg_config.h.win32 src/include/pgstat.h src/include/storage/backendid.h src/include/storage/barrier.h src/include/storage/lwlock.h src/include/storage/proc.h src/include/storage/procarray.h src/include/storage/procsignal.h src/include/storage/smgr.h src/include/tcop/dest.h src/include/tcop/pquery.h src/include/utils/builtins.h src/include/utils/guc.h src/include/utils/lsyscache.h src/include/utils/plancache.h src/include/utils/portal.h src/include/utils/rel.h src/include/utils/tuplesort.h src/include/utils/tuplestore.h src/test/regress/expected/aggregates.out src/test/regress/expected/create_index.out src/test/regress/expected/foreign_data.out src/test/regress/expected/join.out src/test/regress/expected/macaddr.out src/test/regress/expected/polygon.out src/test/regress/expected/rangetypes.out src/test/regress/expected/update.out src/test/regress/input/constraints.source src/test/regress/pg_regress.c src/test/regress/serial_schedule src/test/regress/sql/rangetypes.sql
2015-05-24pgindent run for 9.5Bruce Momjian
2015-05-22Add and use macros IS_PGXC_LOCAL_COORDINATOR and IS_PGXC_REMOTE_COORDINATORPavan Deolasee
This makes the code much more readable. In passing, also add checks for local and remoted coordinator at bunch of places where we are not expected to send down commands to datanodes from a remote coordinator
2015-05-08Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.Andres Freund
The newly added ON CONFLICT clause allows to specify an alternative to raising a unique or exclusion constraint violation error when inserting. ON CONFLICT refers to constraints that can either be specified using a inference clause (by specifying the columns of a unique constraint) or by naming a unique or exclusion constraint. DO NOTHING avoids the constraint violation, without touching the pre-existing row. DO UPDATE SET ... [WHERE ...] updates the pre-existing tuple, and has access to both the tuple proposed for insertion and the existing tuple; the optional WHERE clause can be used to prevent an update from being executed. The UPDATE SET and WHERE clauses have access to the tuple proposed for insertion using the "magic" EXCLUDED alias, and to the pre-existing tuple using the table name or its alias. This feature is often referred to as upsert. This is implemented using a new infrastructure called "speculative insertion". It is an optimistic variant of regular insertion that first does a pre-check for existing tuples and then attempts an insert. If a violating tuple was inserted concurrently, the speculatively inserted tuple is deleted and a new attempt is made. If the pre-check finds a matching tuple the alternative DO NOTHING or DO UPDATE action is taken. If the insertion succeeds without detecting a conflict, the tuple is deemed inserted. To handle the possible ambiguity between the excluded alias and a table named excluded, and for convenience with long relation names, INSERT INTO now can alias its target table. Bumps catversion as stored rules change. Author: Peter Geoghegan, with significant contributions from Heikki Linnakangas and Andres Freund. Testing infrastructure by Jeff Janes. Reviewed-By: Heikki Linnakangas, Andres Freund, Robert Haas, Simon Riggs, Dean Rasheed, Stephen Frost and many others.
2015-04-30Create an infrastructure for parallel computation in PostgreSQL.Robert Haas
This does four basic things. First, it provides convenience routines to coordinate the startup and shutdown of parallel workers. Second, it synchronizes various pieces of state (e.g. GUCs, combo CID mappings, transaction snapshot) from the parallel group leader to the worker processes. Third, it prohibits various operations that would result in unsafe changes to that state while parallelism is active. Finally, it propagates events that would result in an ErrorResponse, NoticeResponse, or NotifyResponse message being sent to the client from the parallel workers back to the master, from which they can then be sent on to the client. Robert Haas, Amit Kapila, Noah Misch, Rushabh Lathia, Jeevan Chalke. Suggestions and review from Andres Freund, Heikki Linnakangas, Noah Misch, Simon Riggs, Euler Taveira, and Jim Nasby.
2015-04-27Merge commit 'ab76208e3df6841b3770edeece57d0f048392237' into XL_MASTER_MERGE_9_4Pavan Deolasee
2015-01-06Update copyright for 2015Bruce Momjian
Backpatch certain files through 9.0
2014-09-01The Postgres-XL functionality includes MPP parallelism withPavan Deolasee
data node to data node communication, more stringent security, and other performance enhancements. Please see release notes. Key contributors are: Andrei Martsinchyk Nikhil Sontakke Mason Sharp
2014-01-07Update copyright for 2014Bruce Momjian
Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
2013-01-01Update copyrights for 2013Bruce Momjian
Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
2012-08-30Split tuple struct defs from htup.h to htup_details.hAlvaro Herrera
This reduces unnecessary exposure of other headers through htup.h, which is very widely included by many files. I have chosen to move the function prototypes to the new file as well, because that means htup.h no longer needs to include tupdesc.h. In itself this doesn't have much effect in indirect inclusion of tupdesc.h throughout the tree, because it's also required by execnodes.h; but it's something to explore in the future, and it seemed best to do the htup.h change now while I'm busy with it.
2012-07-27Merge commit '80edfd76591fdb9beec061de3c05ef4e9d96ce56' into postgres-xc/masterMichael Paquier
This is the merge of Postgres-XC master branch with the intersection of PostgreSQL master branch and 9.2 stable branch. All the manual conflicts are solved, please note that the code does not compile yet. All the compilation will be solved later. Conflicts: COPYRIGHT GNUmakefile.in configure configure.in contrib/pgbench/pgbench.c contrib/sepgsql/hooks.c src/backend/access/common/heaptuple.c src/backend/access/heap/heapam.c src/backend/access/transam/Makefile src/backend/access/transam/rmgr.c src/backend/access/transam/twophase.c src/backend/access/transam/varsup.c src/backend/access/transam/xact.c src/backend/catalog/Makefile src/backend/commands/comment.c src/backend/commands/copy.c src/backend/commands/explain.c src/backend/commands/indexcmds.c src/backend/commands/prepare.c src/backend/commands/tablecmds.c src/backend/commands/view.c src/backend/executor/functions.c src/backend/executor/spi.c src/backend/nodes/copyfuncs.c src/backend/nodes/makefuncs.c src/backend/optimizer/path/allpaths.c src/backend/optimizer/plan/createplan.c src/backend/optimizer/plan/planner.c src/backend/optimizer/plan/setrefs.c src/backend/optimizer/util/var.c src/backend/parser/analyze.c src/backend/parser/gram.y src/backend/parser/parse_agg.c src/backend/postmaster/postmaster.c src/backend/storage/ipc/procarray.c src/backend/storage/lmgr/proc.c src/backend/tcop/postgres.c src/backend/tcop/utility.c src/backend/utils/adt/dbsize.c src/backend/utils/adt/lockfuncs.c src/backend/utils/adt/misc.c src/backend/utils/adt/ruleutils.c src/backend/utils/cache/plancache.c src/backend/utils/misc/guc.c src/bin/initdb/initdb.c src/bin/pg_ctl/pg_ctl.c src/bin/pg_dump/pg_dump.c src/bin/psql/startup.c src/bin/psql/tab-complete.c src/include/Makefile src/include/access/rmgr.h src/include/access/xact.h src/include/catalog/catversion.h src/include/catalog/pg_aggregate.h src/include/catalog/pg_proc.h src/include/commands/explain.h src/include/commands/schemacmds.h src/include/nodes/parsenodes.h src/include/nodes/pg_list.h src/include/nodes/primnodes.h src/include/optimizer/pathnode.h src/include/optimizer/var.h src/include/pg_config.h.win32 src/include/storage/proc.h src/include/utils/plancache.h src/include/utils/snapshot.h src/include/utils/timestamp.h src/test/regress/expected/aggregates.out src/test/regress/expected/create_index.out src/test/regress/expected/inherit.out src/test/regress/expected/rangefuncs.out src/test/regress/expected/sanity_check.out src/test/regress/expected/sequence.out src/test/regress/expected/with.out src/test/regress/output/constraints.source src/test/regress/sql/inherit.sql src/test/regress/sql/rules.sql
2012-06-10Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian
commit-fest.
2012-05-30Update code comments: use "Coordinator" and "Datanode" as conventional termsMichael Paquier
This unifies the convention name for Coordinator and Datanode in Postgres-XC with documentation.
2012-03-09Switch node definition information to shared memory in poolerMichael P
This removes dependency of pooler process with catalog table cache. Shared memory on pooler is organized now as follows: - PoolerMemoryContext (well an existing one), allocated in TopMemoryContext and used by the pooler process - PoolerCoreContext, allocated in PoolerMemoryContext, used by database pool contexts. - PoolerAgentContext, pooler agent context and used by pooler agents. The pooler agent now uses node Oids instead of node indexes. This protects pooler agents in case of node reordering after catalog tables being modified due to node DDL. The warning/error message which was thrown back to client connection from server if connection information was inconsistent is also removed thanks to that. Two new GUC parameters are used to define the maximum number of Coordinators and Datanodes on Coordinator respectively called max_coordinators and max_datanodes. This represents the maximum number of nodes that can be defined in cluster, and does not influence the dynamic behavior of cluster. A node definition slot in shared memory takes approximately 140 bytes. Patch by Andrei Martsinchyk. Review, some fix issues (preferred/primary support...) and some workarounds by me. Performance has been checked by Sutou Takayuki.
2012-02-09Make the transaction level advisory locks cluster aware. This isAmit Khandekar
part2 of the earlier commit that introduced cluster-awareness to session-level advisory locks.
2012-02-01Make the advisory locks cluster-aware, so that a user connected fromAmit Khandekar
coordinator 1 will wait for an advisory lock held by a user connected from coordinator 2. This support is enabled only for session level advisory locks in this commit, Transaction level advisory locks are not included.
2012-01-01Update copyright notices for year 2012.Bruce Momjian
2011-09-01Remove unnecessary #include references, per pgrminclude script.Bruce Momjian
2011-07-18Create a "fast path" for acquiring weak relation locks.Robert Haas
When an AccessShareLock, RowShareLock, or RowExclusiveLock is requested on an unshared database relation, and we can verify that no conflicting locks can possibly be present, record the lock in a per-backend queue, stored within the PGPROC, rather than in the primary lock table. This eliminates a great deal of contention on the lock manager LWLocks. This patch also refactors the interface between GetLockStatusData() and pg_lock_status() to be a bit more abstract, so that we don't rely so heavily on the lock manager's internal representation details. The new fast path lock structures don't have a LOCK or PROCLOCK structure to return, so we mustn't depend on that for purposes of listing outstanding locks. Review by Jeff Davis.
2011-04-04Include pid in pg_lock_status() results even for SIREAD locks.Robert Haas
Dan Ports
2011-02-18Add transaction-level advisory locks.Itagaki Takahiro
They share the same locking namespace with the existing session-level advisory locks, but they are automatically released at the end of the current transaction and cannot be released explicitly via unlock functions. Marko Tiikkaja, reviewed by me.
2011-02-07Implement genuine serializable isolation level.Heikki Linnakangas
Until now, our Serializable mode has in fact been what's called Snapshot Isolation, which allows some anomalies that could not occur in any serialized ordering of the transactions. This patch fixes that using a method called Serializable Snapshot Isolation, based on research papers by Michael J. Cahill (see README-SSI for full references). In Serializable Snapshot Isolation, transactions run like they do in Snapshot Isolation, but a predicate lock manager observes the reads and writes performed and aborts transactions if it detects that an anomaly might occur. This method produces some false positives, ie. it sometimes aborts transactions even though there is no anomaly. To track reads we implement predicate locking, see storage/lmgr/predicate.c. Whenever a tuple is read, a predicate lock is acquired on the tuple. Shared memory is finite, so when a transaction takes many tuple-level locks on a page, the locks are promoted to a single page-level lock, and further to a single relation level lock if necessary. To lock key values with no matching tuple, a sequential scan always takes a relation-level lock, and an index scan acquires a page-level lock that covers the search key, whether or not there are any matching keys at the moment. A predicate lock doesn't conflict with any regular locks or with another predicate locks in the normal sense. They're only used by the predicate lock manager to detect the danger of anomalies. Only serializable transactions participate in predicate locking, so there should be no extra overhead for for other transactions. Predicate locks can't be released at commit, but must be remembered until all the transactions that overlapped with it have completed. That means that we need to remember an unbounded amount of predicate locks, so we apply a lossy but conservative method of tracking locks for committed transactions. If we run short of shared memory, we overflow to a new "pg_serial" SLRU pool. We don't currently allow Serializable transactions in Hot Standby mode. That would be hard, because even read-only transactions can cause anomalies that wouldn't otherwise occur. Serializable isolation mode now means the new fully serializable level. Repeatable Read gives you the old Snapshot Isolation level that we have always had. Kevin Grittner and Dan Ports, reviewed by Jeff Davis, Heikki Linnakangas and Anssi Kääriäinen
2011-01-01Stamp copyrights for year 2011.Bruce Momjian
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2010-01-02Update copyright for the year 2010.Bruce Momjian
2009-01-01Update copyright for 2009.Bruce Momjian
2008-11-02Remove all uses of the deprecated functions heap_formtuple, heap_modifytuple,Tom Lane
and heap_deformtuple in favor of the newer functions heap_form_tuple et al (which do the same things but use bool control flags instead of arbitrary char values). Eliminate the former duplicate coding of these functions, reducing the deprecated functions to mere wrappers around the newer ones. We can't get rid of them entirely because add-on modules probably still contain many instances of the old coding style. Kris Jurka
2008-05-12Restructure some header files a bit, in particular heapam.h, by removing someAlvaro Herrera
unnecessary #include lines in it. Also, move some tuple routine prototypes and macros to htup.h, which allows removal of heapam.h inclusion from some .c files. For this to work, a new header file access/sysattr.h needed to be created, initially containing attribute numbers of system columns, for pg_dump usage. While at it, make contrib ltree, intarray and hstore header files more consistent with our header style.
2008-03-25Simplify and standardize conversions between TEXT datums and ordinary CTom Lane
strings. This patch introduces four support functions cstring_to_text, cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and two macros CStringGetTextDatum and TextDatumGetCString. A number of existing macros that provided variants on these themes were removed. Most of the places that need to make such conversions now require just one function or macro call, in place of the multiple notational layers that used to be needed. There are no longer any direct calls of textout or textin, and we got most of the places that were using handmade conversions via memcpy (there may be a few still lurking, though). This commit doesn't make any serious effort to eliminate transient memory leaks caused by detoasting toasted text objects before they reach text_to_cstring. We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few places where it was easy, but much more could be done. Brendan Jurd and Tom Lane
2008-01-08lmgr.c:DescribeLockTag was never taught about virtual xids, per Greg Stark.Tom Lane
Also a couple of minor tweaks to try to future-proof the code a bit better against future locktag additions.
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-11-15pgindent run for 8.3.Bruce Momjian
2007-09-05Implement lazy XID allocation: transactions that do not modify any databaseTom Lane
rows will normally never obtain an XID at all. We already did things this way for subtransactions, but this patch extends the concept to top-level transactions. In applications where there are lots of short read-only transactions, this should improve performance noticeably; not so much from removal of the actual XID-assignments, as from reduction of overhead that's driven by the rate of XID consumption. We add a concept of a "virtual transaction ID" so that active transactions can be uniquely identified even if they don't have a regular XID. This is a much lighter-weight concept: uniqueness of VXIDs is only guaranteed over the short term, and no on-disk record is made about them. Florian Pflug, with some editorialization by Tom.
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-09-22Fix pg_locks view to call advisory locks advisory locks, while preservingTom Lane
backward compatibility for anyone using the old userlock code that's now on pgfoundry --- locks from that code still show as 'userlock'.
2006-09-18Add built-in userlock manipulation functions to replace the formerTom Lane
contrib functionality. Along the way, remove the USER_LOCKS configuration symbol, since it no longer makes any sense to try to compile that out. No user documentation yet ... mmoncure has promised to write some. Thanks to Abhijit Menon-Sen for creating a first draft to work from.
2006-07-23Convert the lock manager to use the new dynahash.c support for partitionedTom Lane
hash tables, instead of the previous kluge involving multiple hash tables. This partially undoes my patch of last December.
2006-07-14Remove 576 references of include files that were not needed.Bruce Momjian