Re: [HACKERS] New psql input mode problems - Mailing list pgsql-hackers

From Keith Parks
Subject Re: [HACKERS] New psql input mode problems
Date
Msg-id 199911081801.SAA22673@mtcc.demon.co.uk
Whole thread Raw
Responses Re: [HACKERS] New psql input mode problems  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <e99re41@DoCS.UU.SE>
>On Sun, 7 Nov 1999, Bruce Momjian wrote:
>
>> > This seems to be where it goes wrong. (mainloop.c)
>> > 
>> > /* No more input.  Time to quit, or \i done */
>> > if (line == NULL || (!pset->cur_cmd_interactive && *line == '\0'))
>
>This line was there in the old source as well.

Just checked and you're right..

>
>> > 
>> > When a blank line is encountered in the input 
>> > 
>> >     line = gets_fromFile(source);
>> >     
>> > returns an empty string ('\0') and terminates the processing.
>
>Same in the old one.

I think somehow the old version was subtly different.

The old version of psql read and processed the whole of
each regression sql file. The new version stops processing
as soon as it sees a blank line.

I'm not sure if there's something different with the '\n'
handling in the new version. If the '\n' is being stripped
out that could make all the difference between "\n", which
would not terminate and "" which would.

>
>> > 
>> > with the if clause reduced to checking for line == NULL psql
>> > does the work but fails badly due to the differences between
>> > results and expected. (comments, QUERY:, echo processing)
>
>As I said, that part was not my idea. I'll look into that though.

This is a difficult one, I never was any good at decisions.

There are a number of key differences.

Query text OLD  echoed prefixed with "QUERY:" NEW echoed as read.
Formatting OLD  slightly different to         NEW. (alignment and '-'s)


OLD:

QUERY: SELECT 1 AS one;
one
--- 1
(1 row)


NEW:


SELECT 1 AS one;one
-----  1
(1 row)


>
>> 
>> > 
>> > Is the intention to modify expected to agree with the new
>> > results output, or fix psql to output in the expected format?
>
>How about using the old psql for regression testing?

I like the new one better :-)

>
>> 
>> Good question.  We need to know if people like the current output
>> format, or the old one better?
>
>I send in several examples. If no one comments, that's silent approval.
>I am really hesitant to put in a compatibility format, but I might just do
>that until new regression tests are out and you ask me to.
>

If it was not too difficult this would be one way to go.

We really need the regression output maintainer (Tom?) to comment
here. I'd hate to have to do the 1st compare between the new output
and old expected by eye.


Keith.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] New psql compile problem.
Next
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] users in Postgresql