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

Commit71d6d07

Browse files
committed
Allow copydir() to be interrupted.
This makes ALTER DATABASE .. SET TABLESPACE and CREATE DATABASE moresensitive to interrupts. Backpatch to 8.4, where ALTER DATABASE .. SETTABLESPACE was introduced. We could go back further, but in the absenceof complaints about the CREATE DATABASE case it doesn't seem worth it.Guillaume Lelarge, with a small correction by me.
1 parent600fc1d commit71d6d07

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/port/copydir.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*as a service.
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.36 2010/03/0114:54:00 tgl Exp $
14+
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.37 2010/07/0120:12:40 rhaas Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -23,6 +23,7 @@
2323
#include<sys/stat.h>
2424

2525
#include"storage/fd.h"
26+
#include"miscadmin.h"
2627

2728
/*
2829
*On Windows, call non-macro versions of palloc; we can't reference
@@ -69,6 +70,9 @@ copydir(char *fromdir, char *todir, bool recurse)
6970
{
7071
structstatfst;
7172

73+
/* If we got a cancel signal during the copy of the directory, quit */
74+
CHECK_FOR_INTERRUPTS();
75+
7276
if (strcmp(xlde->d_name,".")==0||
7377
strcmp(xlde->d_name,"..")==0)
7478
continue;
@@ -172,6 +176,9 @@ copy_file(char *fromfile, char *tofile)
172176
*/
173177
for (offset=0;;offset+=nbytes)
174178
{
179+
/* If we got a cancel signal during the copy of the file, quit */
180+
CHECK_FOR_INTERRUPTS();
181+
175182
nbytes=read(srcfd,buffer,COPY_BUF_SIZE);
176183
if (nbytes<0)
177184
ereport(ERROR,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp