I have applied a modified version of your patch. I moved the prompt
'text' field as optional before name, and removed the default prompt
string, which seemed un-Unix-like.
I also simplified when stdin/stdout is used. If stdin is the terminal,
it seems it makes no difference if we use the
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
Bruce Momjian wrote:
Seems the consensus was this was a good idea, and not feature-creep.
I wonder whether we want this to read from the console, like the
password prompts, or from stdin. Not sure which is more useful.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
On 2/17/07, Peter Eisentraut [EMAIL PROTECTED] wrote:
Bruce Momjian wrote:
Seems the consensus was this was a good idea, and not feature-creep.
I wonder whether we want this to read from the console, like the
password prompts, or from stdin. Not sure which is more useful.
Good point, I
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
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
Chad Wagner [EMAIL PROTECTED] writes:
Would it make sense to say:
1. if pset.notty is set and '-f' switch is not set then use simple_prompt
2. else then use gets_fromFile(stdin) or some other alternative?
Actually, there's another issue, which is where to send the prompt.
If we're using
On 2/17/07, Tom Lane [EMAIL PROTECTED] wrote:
Chad Wagner [EMAIL PROTECTED] writes:
Would it make sense to say:
1. if pset.notty is set and '-f' switch is not set then use
simple_prompt
2. else then use gets_fromFile(stdin) or some other alternative?
Actually, there's another issue, which
Joshua D. Drake wrote:
Alvaro Herrera wrote:
Joshua D. Drake wrote:
Peter Eisentraut wrote:
Magnus Hagander wrote:
That also requires a reasonable shell, which all platforms don't
have...
I think doing any sort of reasonable scripting around psql requires a
reasonable shell. Or next
On 2/9/07, Alvaro Herrera [EMAIL PROTECTED] wrote:
At least it'd help those poor people trying to do conditional COMMIT or
ROLLBACK based on the transaction status.
The user doesn't need to check the status of the transaction if he just
needs to end it. Just fire the END command and it'll
On 2/9/07, Alvaro Herrera [EMAIL PROTECTED] wrote:
Gurjeet Singh wrote:
On 2/9/07, Alvaro Herrera [EMAIL PROTECTED] wrote:
At least it'd help those poor people trying to do conditional COMMIT or
ROLLBACK based on the transaction status.
The user doesn't need to check the status of the
Chad Wagner wrote:
This adds the ability to prompt for internal variable input, below
are examples:
test=# \prompt x
Enter value for x: 3
You can do this already approximately so:
\echo -n 'Enter value: '
\set x `read echo $REPLY`
Maybe one command is better, though.
--
Peter Eisentraut
On 2/8/07, Chad Wagner [EMAIL PROTECTED] wrote:
This adds the ability to prompt for internal variable input, below are
examples:
In help.c:slashUsage(), the comment says:
/* if you add/remove a line here, change the row count above */
So I guess, the patch should also include a change
On Thu, Feb 08, 2007 at 10:17:19AM +0100, Peter Eisentraut wrote:
Chad Wagner wrote:
This adds the ability to prompt for internal variable input, below
are examples:
test=# \prompt x
Enter value for x: 3
You can do this already approximately so:
\echo -n 'Enter value: '
\set x
Magnus Hagander wrote:
That also requires a reasonable shell, which all platforms don't
have...
I think doing any sort of reasonable scripting around psql requires a
reasonable shell. Or next someone will suggest implementing loops and
conditionals in psql.
For that matter, I suspect in any
On 2/8/07, Peter Eisentraut [EMAIL PROTECTED] wrote:
You can do this already approximately so:
\echo -n 'Enter value: '
\set x `read echo $REPLY`
Maybe one command is better, though.
Yep, in fact that is more or less something similar that I suggested on
pgsql-sql yesterday. The only
On 2/8/07, Gurjeet Singh [EMAIL PROTECTED] wrote:
In help.c:slashUsage(), the comment says:
/* if you add/remove a line here, change the row count above */
So I guess, the patch should also include a change to the line:
output = PageOutput(67, pager); = output = PageOutput(68, pager);
Anyways, here is the patch again with the pager output changed from 67 to
69. Feel free to use it or ignore it, I still think it is a useful patch
and doesn't necessary imply that users will want looping next (although, I
would like to do anonymous PL/pgSQL chunks ;). I just understand how
Peter Eisentraut wrote:
Magnus Hagander wrote:
That also requires a reasonable shell, which all platforms don't
have...
I think doing any sort of reasonable scripting around psql requires a
reasonable shell. Or next someone will suggest implementing loops and
conditionals in psql.
...
Joshua D. Drake wrote:
Peter Eisentraut wrote:
Magnus Hagander wrote:
That also requires a reasonable shell, which all platforms don't
have...
I think doing any sort of reasonable scripting around psql requires a
reasonable shell. Or next someone will suggest implementing loops and
Alvaro Herrera wrote:
Joshua D. Drake wrote:
Peter Eisentraut wrote:
Magnus Hagander wrote:
That also requires a reasonable shell, which all platforms don't
have...
I think doing any sort of reasonable scripting around psql requires a
reasonable shell. Or next someone will suggest
21 matches
Mail list logo