Re: \prompt for psql

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Chad Wagner" <chad(dot)wagner(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Magnus Hagander" <magnus(at)hagander(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: \prompt for psql
Date: 2007-02-18 17:20:58
Message-ID: 200702181820.59869.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2007-02-18 17:26:54 Re: patch for contrib/xml2
Previous Message Heikki Linnakangas 2007-02-18 16:29:12 Re: further bootstrap cleanup