pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tristan Partin <tristan@neon.tech>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers@postgresql.org
Cc: Shlok Kyal <shlok.kyal.oss@gmail.com>
Subject: Re: psql not responding to SIGINT upon db reconnection
Date: Wed, 03 Apr 2024 10:16:58 -0500
Message-ID: <D0AL5FP6NY56.3XTMVQM9UC6P@neon.tech> (raw )
In-Reply-To: <CAGECzQS7Ng36kiq_3nXXzZkeVU9uSiEHO4DqzNHEG294w-X1sA@mail.gmail.com >
References: <CUAJJDVD8L61.2AH6VEEDMTXX3@gonk >
<CUAKHCX5472I.SJP0AWQRYVFA@gonk >
<CUAKIOVISECO.2S7MSQFOP1304@gonk >
<1588058.1690220636@sss.pgh.pa.us >
<CUAO24Z1Y72E.2069AD01EB4LO@gonk >
<CANhcyEVBQWoPJK+C_h1CKyN3Wr2VKHuPx=bSB4PH2LuGdut4qg@mail.gmail.com >
<CWRWDTTPP0WZ.2W75ZAVL5ND1M@neon.tech >
<5e28b89f-0033-4e42-8184-b71b731c1aa2@iki.fi >
<CX5IOLTR8MAD.1UUDEG0X673Z4@neon.tech >
<9b3693b7-0bc3-430a-b43f-eae44e8a39b6@iki.fi >
<CX5NSE8R07D8.9D8M8LBKP119@neon.tech >
<032868e0-a530-4fc7-972c-af6f08950b7e@iki.fi >
<CXBHH2O58HVA.JUP07AES8JVK@neon.tech >
<CXGM82ZEGMR2.8EX2V7UBFIK3@neon.tech >
<CA+TgmoYK1JCJUyrK==TBj7St1hhke5AOwXyrmDAs-pA_mmAwVw@mail.gmail.com >
<CY93J05RFBUI.3VGP5PLTG4EWI@neon.tech >
<CA+TgmoZb1Ojhw9numxWp8nCioh_wULxOcYCQ6Jwku4t_e43PkA@mail.gmail.com >
<CYCWA43RK8AH.11BZB0P45NOD5@neon.tech >
<CYSE2DQI20CH.19LUJSCFH0748@neon.tech >
<CAGECzQTX=esZ+71gAcHGYDBnv65-RGH14xpiFvJytN0uvULzCA@mail.gmail.com >
<CYT3BG48WV2H.25BS2RN173HG9@neon.tech >
<D00FXVDVQG85.1CBNG8IZ2XM8E@neon.tech >
<CA+Tgmob4cu9CZA_LQsSzGqJrN2RKhVLdR1rAP-5L5AA9W8regg@mail.gmail.com >
<D00KWJOWYJ7L.1DZ1LKH01N7WG@neon.tech >
<CA+TgmoacHJ7R9cP4q=XG_AYFtAO-9BV4unK3WqAtSigtv71afg@mail.gmail.com >
<D08WWCPVHKHN.3QELIKZJ2D9RZ@neon.tech >
<CA+TgmoYxJT19tvPPq7=gyLT-BSh-hK=zzhSGpf+bE=Q-WNE8Pg@mail.gmail.com >
<CAGECzQRmbNRz4hQ8JhbopAZLgAg_cQyT+zPxq4u9-kEHXqyXJA@mail.gmail.com >
<2049574.1712154700@sss.pgh.pa.us >
<CAGECzQQ_HEYwXJ7SSzW2fLHNr_SYMvBLs8HPbLdbTJdjRjvOWQ@mail.gmail.com >
<D0AKOPTFMKFK.3W2C0R3131MFF@neon.tech >
<CAGECzQS7Ng36kiq_3nXXzZkeVU9uSiEHO4DqzNHEG294w-X1sA@mail.gmail.com >
On Wed Apr 3, 2024 at 10:05 AM CDT, Jelte Fennema-Nio wrote:
> On Wed, 3 Apr 2024 at 16:55, Tristan Partin <tristan@neon.tech> wrote:
> > Removing from the switch statement causes a warning:
> >
> > > [1/2] Compiling C object src/bin/psql/psql.p/command.c.o
> > > ../src/bin/psql/command.c: In function ‘wait_until_connected’:
> > > ../src/bin/psql/command.c:3803:17: warning: enumeration value ‘PGRES_POLLING_ACTIVE’ not handled in switch [-Wswitch]
> > > 3803 | switch (PQconnectPoll(conn))
> > > | ^~~~~~
>
>
> Ofcourse... fixed now
I think patch 2 makes it worse. The value in -Wswitch is that when new
enum variants are added, the developer knows the locations to update.
Adding a default case makes -Wswitch pointless.
Patch 1 is still good. The comment change in patch 2 is good too!
--
Tristan Partin
Neon (https://neon.tech )
view thread (43+ messages) latest in thread
Message-ID: <D0AL5FP6NY56.3XTMVQM9UC6P@neon.tech>
Permalink: ../D0AL5FP6NY56.3XTMVQM9UC6P@neon.tech/
Also on: postgresql.org/message-id/D0AL5FP6NY56.3XTMVQM9UC6P@neon.tech
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tristan@neon.tech, postgres@jeltef.nl, robertmhaas@gmail.com, hlinnaka@iki.fi, shlok.kyal.oss@gmail.com
Subject: Re: psql not responding to SIGINT upon db reconnection
In-Reply-To: <D0AL5FP6NY56.3XTMVQM9UC6P@neon.tech>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox