Re: psql -e

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: gearond(at)cvc(dot)net
Cc: nolan(at)celery(dot)tssi(dot)com, 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:55:55
Message-ID: 3F20018B.8000703@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In fact, this kind of development, with a test for all code to see if it is using any unwanted features of the language instead of inhouse objects, functions, and macros would have saved microsoft's butt a long time ago regarding security issues. Each new group of programmers does the exact same thing the more experienced programmers a usually not doing any more, i.e. buffer overruns, et. al.

Dennis Gearon wrote:

> 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

  • Re: psql -e at 2003-07-24 15:41:09 from Dennis Gearon

Browse pgsql-general by date

  From Date Subject
Next Message nolan 2003-07-24 16:08:00 Re: psql -et
Previous Message mogas 2003-07-24 15:55:23