Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
50ce8ab9
Commit
50ce8ab9
authored
Mar 24, 2005
by
Neil Conway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert changes to CREATE TRIGGER and ALTER TABLE ADD FOREIGN KEY locking,
per request from Tom.
parent
8abba638
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
21 deletions
+13
-21
doc/src/sgml/mvcc.sgml
doc/src/sgml/mvcc.sgml
+4
-5
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+7
-7
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+2
-9
No files found.
doc/src/sgml/mvcc.sgml
View file @
50ce8ab9
<!--
$PostgreSQL: pgsql/doc/src/sgml/mvcc.sgml,v 2.4
8 2005/03/23 07:44:56
neilc Exp $
$PostgreSQL: pgsql/doc/src/sgml/mvcc.sgml,v 2.4
9 2005/03/24 00:03:18
neilc Exp $
-->
<chapter id="mvcc">
...
...
@@ -677,10 +677,9 @@ SELECT SUM(value) FROM mytab WHERE class = 2;
</para>
<para>
Acquired by <command>CREATE TRIGGER</command> and
<command>ALTER TABLE ADD FOREIGN KEY</command>. This lock
mode can also be acquired on certain system catalogs in some
operations.
This lock mode is not automatically acquired on user tables by any
<productname>PostgreSQL</productname> command. However it is
acquired on certain system catalogs in some operations.
</para>
</listitem>
</varlistentry>
...
...
src/backend/commands/tablecmds.c
View file @
50ce8ab9
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.1
49 2005/03/23 07:44:57
neilc Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.1
50 2005/03/24 00:03:22
neilc Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -3829,13 +3829,13 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel,
Oid
constrOid
;
/*
* Grab a
lock on the pk table, so that someone doesn't delete
*
rows out from under us. We will eventually need to add triggers
* t
o the table, at which point we'll need to an ExclusiveLock --
* the
refore we grab an ExclusiveLock now to prevent possible
*
deadlock.
* Grab a
n exclusive lock on the pk table, so that someone doesn't
*
delete rows out from under us. (Although a lesser lock would do for
* t
hat purpose, we'll need exclusive lock anyway to add triggers to
* the
pk table; trying to start with a lesser lock will just create a
*
risk of deadlock.)
*/
pkrel
=
heap_openrv
(
fkconstraint
->
pktable
,
ExclusiveLock
);
pkrel
=
heap_openrv
(
fkconstraint
->
pktable
,
Access
ExclusiveLock
);
/*
* Validity and permissions checks
...
...
src/backend/commands/trigger.c
View file @
50ce8ab9
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.1
79 2005/03/23 07:44:57
neilc Exp $
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.1
80 2005/03/24 00:03:26
neilc Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -87,14 +87,7 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
ObjectAddress
myself
,
referenced
;
/*
* We need to prevent concurrent CREATE TRIGGER commands, as well
* as concurrent table modifications (INSERT, DELETE, UPDATE), so
* acquire an ExclusiveLock -- it should be fine to allow SELECTs
* to proceed. We could perhaps acquire ShareRowExclusiveLock, but
* there seems little gain in allowing SELECT FOR UPDATE.
*/
rel
=
heap_openrv
(
stmt
->
relation
,
ExclusiveLock
);
rel
=
heap_openrv
(
stmt
->
relation
,
AccessExclusiveLock
);
if
(
stmt
->
constrrel
!=
NULL
)
constrrelid
=
RangeVarGetRelid
(
stmt
->
constrrel
,
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment