Re: psql -e - Mailing list pgsql-general

From nolan@celery.tssi.com
Subject Re: psql -e
Date
Msg-id 20030724153355.10715.qmail@celery.tssi.com
Whole thread Raw
In response to Re: psql -e  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> I think throwing in another fflush or two would count as a bug fix.
> Anything more extensive probably has to wait for the 7.5 cycle.

Dealing with readline makes it slightly more complicated than that,
because there is an intermingling issue with two independent output
streams.

In addition to a couple of well-placed fflush's, my hack around the
intermingling problem (which apparently only shows up when using the \o
option) was to throw a sleep(1) in before it sends the prompt
and queries the next line from the terminal, to give things a chance
to finish, but I don't know if that is a production-quality fix.
(I did find a couple of other examples in the code of a sleep() thrown
in apparently to resolve timing issues.)

I can take out the code I added to echo the command to the \o stream,
since that is a feature that I would probably want to amplify upon anyway.

If the team would accept the rest as a bugfix, I can send it.  Otherwise,
I'll wait for 7.5 and see if I can change the whole output section to
eliminate the problem completely.
--
Mike Nolan

pgsql-general by date:

Previous
From: Thien-Thi Nguyen
Date:
Subject: Re: quoting of array elements + sexp_out?
Next
From: Dennis Gearon
Date:
Subject: Re: SAP DB: The unsung Open Source DB