Skip to Content
PostgreSQL 10 Administration Cookbook - Fourth Edition
book

PostgreSQL 10 Administration Cookbook - Fourth Edition

by Simon Riggs, Gianni Ciolli
May 2018
Intermediate to advanced content levelIntermediate to advanced
576 pages
30h 25m
English
Packt Publishing
Content preview from PostgreSQL 10 Administration Cookbook - Fourth Edition

How it works…

The pg_terminate_backend() function sends a signal directly to the operating system process for that session.

It's possible that the session may have closed by the time pg_terminate_backend() is named. As PID numbers are assigned by the operating system, it could even happen that you try to terminate a given session (call it "session A"), but you actually terminate another session (call it "session B").

Here is how it could happen. Suppose you take note of the PID of session A and decide to disconnect it. Before you actually issue pg_terminate_backend(), session A disconnects, and right after, a new session B is given exactly the same PID. So, when you terminate that PID, you hit session B instead.

On the one hand, you need ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL 13 Cookbook

PostgreSQL 13 Cookbook

Vallarapu Naga Avinash Kumar
PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini

Publisher Resources

ISBN: 9781788474924Supplemental Content