mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
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 first character is a '/', right? Ross J. Reedstrom
This commit is contained in:
parent
b2d867fb08
commit
4ddc50dffa
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/lock.sgml,v 1.14 1999/10/01 15:26:29 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/lock.sgml,v 1.15 2000/03/23 21:38:57 momjian Exp $
|
||||||
Postgres documentation
|
Postgres documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -32,6 +32,70 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<refsect2info>
|
<refsect2info>
|
||||||
<date>1999-06-09</date>
|
<date>1999-06-09</date>
|
||||||
</refsect2info>
|
</refsect2info>
|
||||||
|
|
||||||
|
<title>
|
||||||
|
Terms
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>EXCLUSIVE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Exclusive lock that prevents other locks from being granted.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>SHARE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allows others to share lock. Prevents EXCLUSIVE locks.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>ACCESS</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Locks table schema.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>ROW</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Locks individual rows.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>Notes</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If EXCLUSIVE or SHARE are not speicified, EXCLUSIVE is assumed.
|
||||||
|
If ROW or ACCESS is not specified, the entire table is locked
|
||||||
|
for the duration of the transaction.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</title>
|
</title>
|
||||||
@ -53,17 +117,17 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
This lock mode is acquired automatically over tables being queried.
|
This lock mode is acquired automatically over tables being queried.
|
||||||
<productname>Postgres</productname> releases automatically acquired
|
This lock is released automatically after the statement completes.
|
||||||
ACCESS SHARE locks after the statement is done.
|
It does not remain for the duration of the transaction.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This is the least restrictive lock mode which conflicts only with
|
This is the least restrictive lock mode which conflicts only with
|
||||||
ACCESS EXCLUSIVE mode. It is intended to protect a table being
|
ACCESS EXCLUSIVE mode. It is intended to protect a table being
|
||||||
queried from concurrent <command>ALTER TABLE</command>,
|
modified by concurrent <command>ALTER TABLE</command>,
|
||||||
<command>DROP TABLE</command> and <command>VACUUM</command>
|
<command>DROP TABLE</command> and <command>VACUUM</command>
|
||||||
statements over the same table.
|
commands.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -74,6 +138,8 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Automatically acquired by any <command>SELECT FOR UPDATE</command> statement.
|
Automatically acquired by any <command>SELECT FOR UPDATE</command> statement.
|
||||||
|
While it is a SHARE lock, there is the intention to later upgrade
|
||||||
|
this to an EXCLUSIVE lock.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
@ -90,7 +156,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<para>
|
<para>
|
||||||
Automatically acquired by any <command>UPDATE</command>,
|
Automatically acquired by any <command>UPDATE</command>,
|
||||||
<command>DELETE</command>, <command>INSERT</command> statement.
|
<command>DELETE</command>, <command>INSERT</command> statement.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -107,6 +173,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Automatically acquired by any <command>CREATE INDEX</command> statement.
|
Automatically acquired by any <command>CREATE INDEX</command> statement.
|
||||||
|
Share-locks entire table.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
@ -123,10 +190,10 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<listitem>
|
<listitem>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Conflicts with ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
|
This is like an EXCLUSIVE lock, but allows SHARE ROW locks
|
||||||
EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is more
|
by others.
|
||||||
restrictive than SHARE mode because of only one transaction
|
Conflicts with ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
|
||||||
at time can hold this lock.
|
EXCLUSIVE and ACCESS EXCLUSIVE modes.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -139,7 +206,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
Conflicts with ROW SHARE, ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
|
Conflicts with ROW SHARE, ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
|
||||||
EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is yet more
|
EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is yet more
|
||||||
restrictive than that of SHARE ROW EXCLUSIVE; it blocks all concurrent
|
restrictive than that of SHARE ROW EXCLUSIVE; it blocks all concurrent
|
||||||
SELECT FOR UPDATE queries.
|
SHARE ROW/SELECT FOR UPDATE queries.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -149,7 +216,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
|
|||||||
<listitem>
|
<listitem>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Automatically acquired by <command>ALTER TABLE</command>,
|
Automatically acquired by <command>ALTER TABLE</command>,
|
||||||
<command>DROP TABLE</command>, <command>VACUUM</command> statements.
|
<command>DROP TABLE</command>, <command>VACUUM</command> statements.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.102 2000/03/09 05:00:23 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.103 2000/03/23 21:38:58 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -348,6 +348,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
mode_t oumask; /* Pre-existing umask value */
|
mode_t oumask; /* Pre-existing umask value */
|
||||||
|
|
||||||
oumask = umask((mode_t) 022);
|
oumask = umask((mode_t) 022);
|
||||||
|
|
||||||
|
if (*filename != '/')
|
||||||
|
elog(ERROR, "Relative path not allowed for server side"
|
||||||
|
" COPY command.");
|
||||||
|
|
||||||
#ifndef __CYGWIN32__
|
#ifndef __CYGWIN32__
|
||||||
fp = AllocateFile(filename, "w");
|
fp = AllocateFile(filename, "w");
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user