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

From Chad Wagner
Subject Re: \prompt for psql
Date
Msg-id 81961ff50702170553s5020818dyf88531acf62fec97@mail.gmail.com
Whole thread Raw
In response to Re: \prompt for psql  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches
On 2/17/07, Peter Eisentraut <peter_e@gmx.net> 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 know that Oracle's "prompt" feature reads from stdin.  If it were to use stdin, would gets_fromFile be appropriate in place of simple_prompt, or is there other alternatives that would be linked in with psql?



Also on a different issue related to variable substitution, has anyone considered making the variable substitutions automatically "determine" datatype?  It is awfully tricky to understand (I am not sure the specific case below is actually documented?) that something like:

\set foo bar
select * from baz where x = :foo

Will not work, and you have to do:

\set foo '\'bar\''
select * from baz where x = :foo


It would be nice if it assumed a char datatype, or something else.  Should I post this second half on variable substitution to hackers?

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: patch adding new regexp functions
Next
From: Magnus Hagander
Date:
Subject: Re: \prompt for psql