Re: 8.1.3 and unused files

Rod Taylor <pg@rbt.ca>

From: Rod Taylor <pg@rbt.ca>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2006-05-05T22:22:41Z
Lists: pgsql-hackers
On Fri, 2006-05-05 at 16:11 -0400, Tom Lane wrote:
> Rod Taylor <pg@rbt.ca> writes:
> > % 1960  2006-05-02 17:03:19 EDTLOG:  00000: server process (PID 10171) exited with exit code 1
> 
> Hm.  I wonder if there are any uses of "exit(1)" in the Slony triggers.

It doesn't appear so. It does have this though:

Datum
_Slony_I_killBackend(PG_FUNCTION_ARGS)
{
	int32		pid;
	int32		signo;
	text	   *signame;

	if (!superuser())
		elog(ERROR, "Slony-I: insufficient privilege for killBackend");

	pid		= PG_GETARG_INT32(0);
	signame	= PG_GETARG_TEXT_P(1);

	if (VARSIZE(signame) == VARHDRSZ + 4 &&
		memcmp(VARDATA(signame), "NULL", 0) == 0)
	{
		signo = 0;
	}
	else if (VARSIZE(signame) == VARHDRSZ + 4 &&
		memcmp(VARDATA(signame), "TERM", 0) == 0)
	{
		signo = SIGTERM;
	}
	else
	{
		elog(ERROR, "Slony-I: unsupported signal");
	}

	if (kill(pid, signo) < 0)
		PG_RETURN_INT32(-1);

	PG_RETURN_INT32(0);
}

--