diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-08-08 01:31:15 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-08-08 01:31:15 +0000 |
commit | 5e01aa7ad122c1b011df7a14370d2c34d53ddeb4 (patch) | |
tree | d8490989ea0b5130008e9ad023c9f9fec4eef67e /src/backend/commands/tablespace.c | |
parent | 9b3caebb0aa38f5669bc1018de24535eafab67af (diff) | |
download | postgresql-5e01aa7ad122c1b011df7a14370d2c34d53ddeb4.tar.gz postgresql-5e01aa7ad122c1b011df7a14370d2c34d53ddeb4.zip |
Fixups for Win32 symlinks.
Diffstat (limited to 'src/backend/commands/tablespace.c')
-rw-r--r-- | src/backend/commands/tablespace.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 1a9e69dc123..05a13315a1f 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -45,7 +45,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.7 2004/08/01 20:30:48 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.8 2004/08/08 01:31:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -482,11 +482,20 @@ DropTableSpace(DropTableSpaceStmt *stmt) errmsg("could not unlink file \"%s\": %m", subfile))); +#ifndef WIN32 if (unlink(location) < 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not unlink symbolic link \"%s\": %m", location))); +#else + /* The junction is a directory, not a file */ + if (rmdir(location) < 0) + ereport(ERROR, + (errcode_for_file_access(), + errmsg("could not remove junction dir \"%s\": %m", + location))); +#endif pfree(subfile); pfree(location); |