Re: \prompt for psql

From: "Chad Wagner" <chad(dot)wagner(at)gmail(dot)com>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, "Bruce Momjian" <bruce(at)momjian(dot)us>
Subject: Re: \prompt for psql
Date: 2007-02-17 13:53:08
Message-ID: 81961ff50702170553s5020818dyf88531acf62fec97@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On 2/17/07, Peter Eisentraut <peter_e(at)gmx(dot)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?

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2007-02-17 14:01:54 Re: \prompt for psql
Previous Message Peter Eisentraut 2007-02-17 09:20:08 Re: patch adding new regexp functions