Re: \prompt for psql - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: \prompt for psql
Date
Msg-id 200702181820.59869.peter_e@gmx.net
Whole thread Raw
In response to Re: \prompt for psql  ("Chad Wagner" <chad.wagner@gmail.com>)
List pgsql-patches
Chad Wagner wrote:
> 1. if pset.notty is set and '-f' switch is not set then use
> simple_prompt -- deals with SQL script redirection case and '-f' is
> not used, and not interactive
> 2. else then use gets_fromFile(stdin) <or some other alternative?>
> (read from stdin)

That seems a bit too complicated.  Programs generally shouldn't behave
differently depending on whether stdin or stdout are redirected.

I was just raising the point because the shell command "read" reads from
stdin and is quite useful noninteractively.  I'm not sure, however,
that the proposed \prompt command has much use in that regard.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-patches by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: further bootstrap cleanup
Next
From: Peter Eisentraut
Date:
Subject: Re: patch for contrib/xml2