| From: | Michael Fuhr <mike(at)fuhr(dot)org> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Jakub Wo?ny <kubaw(at)o2(dot)pl>, pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: C function - other process |
| Date: | 2005-04-22 20:01:50 |
| Message-ID: | 20050422200150.GA93845@winnie.fuhr.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On Fri, Apr 22, 2005 at 03:39:55PM -0400, Tom Lane wrote:
> Jakub =?ISO-8859-2?Q?Wo=BCny?= <kubaw(at)o2(dot)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/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2005-04-22 20:07:48 | Re: C function - other process |
| Previous Message | Tom Lane | 2005-04-22 19:39:55 | Re: C function - other process |