Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4ddc50d

Browse files
committed
Hmm, absolute pathnames for the copy makes sense. I'll whip up that
patch in a second. Should be sufficent to just make sure the firstcharacter is a '/', right?Ross J. Reedstrom
1 parentb2d867f commit4ddc50d

File tree

2 files changed

+85
-13
lines changed

2 files changed

+85
-13
lines changed

‎doc/src/sgml/ref/lock.sgml

Lines changed: 79 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/lock.sgml,v 1.14 1999/10/01 15:26:29 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/lock.sgml,v 1.15 2000/03/23 21:38:57 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -32,6 +32,70 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
3232
<refsect2info>
3333
<date>1999-06-09</date>
3434
</refsect2info>
35+
36+
<title>
37+
Terms
38+
</title>
39+
<para>
40+
<variablelist>
41+
<varlistentry>
42+
<term>EXCLUSIVE</term>
43+
<listitem>
44+
<para>
45+
Exclusive lock that prevents other locks from being granted.
46+
</para>
47+
</listitem>
48+
</varlistentry>
49+
</variablelist>
50+
51+
<variablelist>
52+
<varlistentry>
53+
<term>SHARE</term>
54+
<listitem>
55+
<para>
56+
Allows others to share lock. Prevents EXCLUSIVE locks.
57+
</para>
58+
</listitem>
59+
</varlistentry>
60+
</variablelist>
61+
62+
<variablelist>
63+
<varlistentry>
64+
<term>ACCESS</term>
65+
<listitem>
66+
<para>
67+
Locks table schema.
68+
</para>
69+
</listitem>
70+
</varlistentry>
71+
</variablelist>
72+
73+
<variablelist>
74+
<varlistentry>
75+
<term>ROW</term>
76+
<listitem>
77+
<para>
78+
Locks individual rows.
79+
</para>
80+
</listitem>
81+
</varlistentry>
82+
</variablelist>
83+
84+
<variablelist>
85+
<varlistentry>
86+
<term>Notes</term>
87+
<listitem>
88+
<para>
89+
If EXCLUSIVE or SHARE are not speicified, EXCLUSIVE is assumed.
90+
If ROW or ACCESS is not specified, the entire table is locked
91+
for the duration of the transaction.
92+
</para>
93+
</listitem>
94+
</varlistentry>
95+
</variablelist>
96+
97+
</para>
98+
3599
<title>
36100
Inputs
37101
</title>
@@ -53,17 +117,17 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
53117
<note>
54118
<para>
55119
This lock mode is acquired automatically over tables being queried.
56-
<productname>Postgres</productname> releasesautomaticallyacquired
57-
ACCESS SHARE locks afterthestatement is done.
120+
This lock is releasedautomaticallyafter the statement completes.
121+
It does not remain fortheduration of the transaction.
58122
</para>
59123
</note>
60124

61125
<para>
62126
This is the least restrictive lock mode which conflicts only with
63127
ACCESS EXCLUSIVE mode. It is intended to protect a table being
64-
queried from concurrent <command>ALTER TABLE</command>,
128+
modified by concurrent <command>ALTER TABLE</command>,
65129
<command>DROP TABLE</command> and <command>VACUUM</command>
66-
statements over the same table.
130+
commands.
67131
</para>
68132
</listitem>
69133
</varlistentry>
@@ -74,6 +138,8 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
74138
<note>
75139
<para>
76140
Automatically acquired by any <command>SELECT FOR UPDATE</command> statement.
141+
While it is a SHARE lock, there is the intention to later upgrade
142+
this to an EXCLUSIVE lock.
77143
</para>
78144
</note>
79145

@@ -90,7 +156,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
90156
<para>
91157
Automatically acquired by any <command>UPDATE</command>,
92158
<command>DELETE</command>, <command>INSERT</command> statement.
93-
</para>
159+
</para>
94160
</note>
95161

96162
<para>
@@ -107,6 +173,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
107173
<note>
108174
<para>
109175
Automatically acquired by any <command>CREATE INDEX</command> statement.
176+
Share-locks entire table.
110177
</para>
111178
</note>
112179

@@ -123,10 +190,10 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
123190
<listitem>
124191

125192
<para>
126-
Conflicts with ROWEXCLUSIVE, SHARE,SHARE ROWEXCLUSIVE,
127-
EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is more
128-
restrictive than SHARE mode because of only one transaction
129-
at time can hold this lock.
193+
This is like anEXCLUSIVE lock, but allowsSHARE ROWlocks
194+
by others.
195+
Conflicts with ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
196+
EXCLUSIVE and ACCESS EXCLUSIVE modes.
130197
</para>
131198
</listitem>
132199
</varlistentry>
@@ -139,7 +206,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
139206
Conflicts with ROW SHARE, ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
140207
EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is yet more
141208
restrictive than that of SHARE ROW EXCLUSIVE; it blocks all concurrent
142-
SELECT FOR UPDATE queries.
209+
SHARE ROW/SELECT FOR UPDATE queries.
143210
</para>
144211
</listitem>
145212
</varlistentry>
@@ -149,7 +216,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
149216
<listitem>
150217
<note>
151218
<para>
152-
Automatically acquired by <command>ALTER TABLE</command>,
219+
Automatically acquired by <command>ALTER TABLE</command>,
153220
<command>DROP TABLE</command>, <command>VACUUM</command> statements.
154221
</para>
155222
</note>

‎src/backend/commands/copy.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.102 2000/03/09 05:00:23 inoue Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.103 2000/03/23 21:38:58 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -348,6 +348,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
348348
mode_toumask;/* Pre-existing umask value */
349349

350350
oumask=umask((mode_t)022);
351+
352+
if (*filename!='/')
353+
elog(ERROR,"Relative path not allowed for server side"
354+
" COPY command.");
355+
351356
#ifndef__CYGWIN32__
352357
fp=AllocateFile(filename,"w");
353358
#else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp