pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jakub Wo?ny <kubaw@o2.pl>
Cc: pgsql-sql@postgresql.org
Subject: Re: C function - other process
Date: Fri, 22 Apr 2005 14:01:50 -0600
Message-ID: <20050422200150.GA93845@winnie.fuhr.org> (raw)
In-Reply-To: <12255.1114198795@sss.pgh.pa.us>
References: <20050422211800.241cf201@localhost>
	<12255.1114198795@sss.pgh.pa.us>

On Fri, Apr 22, 2005 at 03:39:55PM -0400, Tom Lane wrote:
> Jakub =?ISO-8859-2?Q?Wo=BCny?= <kubaw@o2.pl> writes:
> > I wrote a simple function:
> 
> >     signal(SIGCHLD,SIG_IGN);
> >     switch(fork())
> 
> This will NOT work.  It WILL corrupt your database.  You do not get to
> randomly introduce new processes into the backend set.

What about fork() followed by exec*(), either explicitly or via
popen(), system(), etc.?  Should these be avoided as well, or is
there a safe way to do them?  I'm thinking of the case where a
user-defined function wants to invoke some external command -- I've
done that in experiments but I've never been sure how safe it was.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (5+ messages)  latest in thread

Message-ID: <20050422200150.GA93845@winnie.fuhr.org>
Permalink:  ../20050422200150.GA93845@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050422200150.GA93845@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, tgl@sss.pgh.pa.us, kubaw@o2.pl
  Subject: Re: C function - other process
  In-Reply-To: <20050422200150.GA93845@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox