On 2/17/07, Tom Lane <[EMAIL PROTECTED]> wrote:

Bruce Momjian <[EMAIL PROTECTED]> writes:
> stdin makes it impossible to read a script from stdin and still prompt
> the user, but I think that is of limited usefulness.

You can always get around that by reading the script with -f instead.
On balance I can see a lot more uses for read-from-stdin than the other;
however, we do need to define what happens if the command appears when
commands are coming from stdin.

Would it make sense to say:

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)
     -- deals with "prompt value" redirection case and '-f' is used, or

It appears that pset.notty will get set to 1 when stdin is not a tty device,
which should be the case for redirection.

Reply via email to