Re: open item: tablespace handing in pg_dump/pg_restore

Поиск
Список
Период
Сортировка
От Reini Urban
Тема Re: open item: tablespace handing in pg_dump/pg_restore
Дата
Msg-id 41619937.8020206@x-ray.at
обсуждение исходный текст
Ответ на Re: open item: tablespace handing in pg_dump/pg_restore  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: open item: tablespace handing in pg_dump/pg_restore  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: open item: tablespace handing in pg_dump/pg_restore  (Reini Urban <rurban@x-ray.at>)
Re: open item: tablespace handing in pg_dump/pg_restore  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane schrieb:
> Gavin Sherry <swm@linuxworld.com.au> writes:
>>I though this may have been the problem. configure.in defines HAVE_SYMLINK
>>to 1 if we are win32. It seems that for Reini's case we are setting our
>>template (and PORTNAME) to win32 when I suspect it should be cygwin.
>>Anyone got any ideas?
>
> What are the prospects of making the junction code work under cygwin?

Somethink like the attached patch is easier.
Just replace symlink() for dirs with link() #ifdef  __CYGWIN__

just wait a sec until the tests run through...
(completely fresh build)
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Index: tablespace.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/tablespace.c,v
retrieving revision 1.11
diff -u -b -r1.11 tablespace.c
--- tablespace.c    30 Aug 2004 02:54:38 -0000    1.11
+++ tablespace.c    4 Oct 2004 18:37:13 -0000
@@ -349,7 +349,11 @@
     linkloc = (char *) palloc(strlen(DataDir) + 11 + 10 + 1);
     sprintf(linkloc, "%s/pg_tblspc/%u", DataDir, tablespaceoid);

+#ifdef __CYGWIN__
+    if (link(location, linkloc) < 0)
+#else
     if (symlink(location, linkloc) < 0)
+#endif
         ereport(ERROR,
                 (errcode_for_file_access(),
                  errmsg("could not create symbolic link \"%s\": %m",
@@ -976,7 +980,11 @@
         linkloc = (char *) palloc(strlen(DataDir) + 11 + 10 + 1);
         sprintf(linkloc, "%s/pg_tblspc/%u", DataDir, xlrec->ts_id);

+#ifdef __CYGWIN__
+        if (link(location, linkloc) < 0)
+#else
         if (symlink(location, linkloc) < 0)
+#endif
         {
             if (errno != EEXIST)
                 ereport(ERROR,

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: is it a known issue or just a bug?
Следующее
От: Greg Stark
Дата:
Сообщение: Re: FunctionCall2 performance