New psql input mode problems - Mailing list pgsql-hackers

From Keith Parks
Subject New psql input mode problems
Date
Msg-id 199911071651.QAA01773@mtcc.demon.co.uk
Whole thread Raw
Responses Re: [HACKERS] New psql input mode problems  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Hi all,

I was wondering why all the regression tests failed for me so i ran one
in the interactive mode.


mtcc:[/usr/local/pgsql/src/test/regress](73)% /usr/local/pgsql/bin/psql 
regression
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms      \h for help with SQL commands      \? for help on internal slash commands
    \g or terminate with semicolon to execute query      \q to quit
 

regression=> \i sql/boolean.sql 

regression=>

I got nothing onscreen and no work was done.

After some digging I found that in non interactive mode psql
stops processing a file as soon as it gets to a blank line.

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'))

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

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)

Is the intention to modify expected to agree with the new
results output, or fix psql to output in the expected format?

Keith.



pgsql-hackers by date:

Previous
From: "Damond Walker"
Date:
Subject: psql and 6.5.3
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] psql and 6.5.3