snacktime <snacktime@gmail.com> writes:
> What's a safe way to kill a specific connection to the database? I'm
> testing some code that reconnects if a connection has timed out or
> gone bad and I need to simulate a connection that has gone away.
Disconnecting a network cable might be the easiest test. Anything
involving a process kill is not a realistic test, because the kernel
will report connection closure to the other end, which is a luxury
you don't get in the real-world cases where this is an issue.
regards, tom lane