Re: Use of 'cp -r' in CREATE DATABASE - Mailing list pgsql-hackers

From Nigel J. Andrews
Subject Re: Use of 'cp -r' in CREATE DATABASE
Date
Msg-id Pine.LNX.4.21.0312120043590.27785-100000@ponder.fairway2k.co.uk
Whole thread Raw
In response to Re: Use of 'cp -r' in CREATE DATABASE  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: Use of 'cp -r' in CREATE DATABASE
Re: Use of 'cp -r' in CREATE DATABASE
List pgsql-hackers
On Thu, 11 Dec 2003, Alvaro Herrera wrote:

> On Thu, Dec 11, 2003 at 06:36:05PM -0500, Bruce Momjian wrote:
> > Our dbcommands.c has for create database:
> > 
> >     snprintf(buf, sizeof(buf), "cp -r '%s' '%s'", src_loc, target_dir);
> > 
> [...]
> > 
> > I think we should switch to -R in our code.
> 
> But you will have to write special code for Win32, won't you?
> Maybe it would be better to avoid using system commands
> altogether and copy the whole thing using syscalls ...

That was my immediate thought. Unfortunately that means reinventing the
wheel; or grabbing it from BSD or somewhere and distributing it with
postgresql.


-- 
Nigel J. Andrews



pgsql-hackers by date:

Previous
From: Philip Yarra
Date:
Subject: Re: Use of 'cp -r' in CREATE DATABASE
Next
From: Bruce Momjian
Date:
Subject: Re: Use of 'cp -r' in CREATE DATABASE