Re: psql -e

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: nolan(at)celery(dot)tssi(dot)com
Cc: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: psql -e
Date: 2003-07-24 15:41:09
Message-ID: 3F1FFE15.5000804@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A macro for the print, which substitutes:

print()
fflush()

for a bare print is a good idea.

And then have a routine that looks for contributions that are mistakenly NOT using the macro.

nolan(at)celery(dot)tssi(dot)com wrote:

>>>The query is printed *before* it is executed, but you might not see it
>>>because your terminal is not flushing the stdout at the right times.
>>
>>thanks ,
>>shud there be a fflush then after that print?
>>or there is something i can do on the shell itself?
>
>
> I've been looking into the echo feature, especially as it relates
> to the \o feature, and there are several places where an fflush
> would be helpful so that the output appears on a timely basis and always
> appears in the same order if readline is being used, because
> readline appears to maintain an independent output buffer.
>
> I made the changes for me in 7.3.3 to add some missing fflush's and also
> changed it so that if echo queries and \o are both on, then the query
> is echoed to the output file.
>
> I can probably create diffs for 7.3.3 if you want them.
>
> This was before I got cvs working here, so I have not yet tried these
> patches in 7.4. I've been holding back in part because of the 7.4 feature
> freeze period (though that might not be enough of a feature change
> to raise eyebrows), and also because there appears to be some readline
> complications. For example, if you try to backspace you can get some
> weird looking terminal output.
>
> The output sections of psql should probably be rewritten to ensure it
> doesn't intermingle output. It may be desirable to use parallel
> streams to the console and to an output file (if defined), but that was
> a bit more than I wanted to bite off as my first project at the time.
>
> Tom, would rewriting the output sections interfere with any changes
> you are/were working on in psql? I probably won't have time to work on
> this before August 15th at this point, so maybe I should wait until we're
> ready to start on 7.5 stuff, in which case I may propose several changes
> in the definitions and options for both the echo and output options
> in psql.
> --
> Mike Nolan
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-07-24 15:44:58 Re: optimum postgres server configuration
Previous Message nolan 2003-07-24 15:39:46 Re: optimum postgres server configuration