# Ctrl-C in psql gives me the heebie-jeebies

DevFeed: [Ctrl-C in psql gives me the heebie-jeebies](<https://devfeed.tech/articles/ctrl-c-in-psql-gives-me-the-heebie-jeebies-5157.md>)

Original publisher: [Read original article](<https://neon.com/blog/ctrl-c-in-psql-gives-me-the-heebie-jeebies>)

Author: George MacKerron

Published: 2026-03-05T16:32:34Z

Content type: article

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [client](<https://devfeed.tech/topics/client.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [TLS (Transport Layer Security)](<https://devfeed.tech/topics/tls.md>), [Process](<https://devfeed.tech/topics/process.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [command-line](<https://devfeed.tech/tags/command-line.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [process](<https://devfeed.tech/tags/process.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [sql](<https://devfeed.tech/tags/sql.md>), [tls](<https://devfeed.tech/tags/tls.md>)

## AI overview

Explains how Ctrl-C cancels a PostgreSQL query in psql: the client opens a separate connection and sends a CancelRequest targeting the original connection, which can create a race condition. It also examines the security implications of sending this request unencrypted despite TLS on the query connection.

## Source excerpt

There are a few different reasons to hit the brakes on a Postgres query. Maybe it's taking too long to finish. Maybe you realised you forgot to create an index that will make it orders of magnitude quicker. Maybe there's some reason the results are no longer needed. Or maybe you,...