Re: [PATCHES] libpq cleanup for SIGPIPE and stderr concerns

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: pgsql-interfaces(at)postgreSQL(dot)org, pgsql-patches(at)postgreSQL(dot)org
Subject: Re: [PATCHES] libpq cleanup for SIGPIPE and stderr concerns
Date: 1998-08-09 03:00:27
Message-ID: 199808090300.XAA29489@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> The attached patch implements some changes that were discussed a couple
> weeks ago on the hackers and interfaces lists:
> 1. When the backend sends a NOTICE message and closes the connection
> (typically, because it was told to by the postmaster after another
> backend coredumped), libpq will now print the notice and close the
> connection cleanly. Formerly, the frontend app would usually
> terminate ungracefully due to a SIGPIPE. (I am not sure if 6.3.2
> behaved that way, but the current cvs sources do...)
> 2. libpq's various printouts to stderr are now fed through a single
> "notice processor" routine, which can be overridden by the
> application to direct notices someplace else. This should ease
> porting libpq to Windows.
>
> I also noticed and fixed a problem in PQprint: when sending output
> to a pager subprocess, it would disable SIGPIPE in case the pager
> terminates early (this is good) --- but afterwards it reset SIGPIPE to
> SIG_DFL, rather than restoring the application's prior setting (bad).
>
> regards, tom lane
>

Patch applied.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bruce Momjian 1998-08-09 03:12:09 Re: [HACKERS] thread-safe libpq and DBD::Pg
Previous Message Tom Lane 1998-08-09 00:51:18 Re: [HACKERS] thread-safe libpq and DBD::Pg