From: SAKAIDA <sakaida@psn.co.jp>
To: Oleg Bartunov <oleg@sai.msu.su>
To: pgsql-hackers@postgreSQL.org
Subject: Re: [HACKERS] pgbash-1.1.1 release
Date: Sat, 02 Oct 1999 12:39:47 +0900
Message-ID: <37F57E83118.743FSAKAIDA@smtp.psn.ne.jp> (raw)
In-Reply-To: <Pine.GSO.3.96.SK.991002021011.16613m-100000@ra>
References: <37F4C04A1B8.A39FSAKAIDA@smtp.psn.ne.jp>
<Pine.GSO.3.96.SK.991002021011.16613m-100000@ra>
Oleg Bartunov <oleg@sai.msu.su> wrote:
> Sakaida,
>
> sorry for bothering you but I didn't find
> TODO file and wondering what new features (if any)
> you plan to implement to pgbash.
Please give me your opinion. My plan is not yet the concrete,
but a few of my new plan are:
1. Improvement of function of an HTML output.
exec_sql -H -O "<TABLE option>"
-O "*:<TH option1>" -O "name:<TH option2>"
-O "*:<TD option3>" -O "addr:<TD option4>"
-F "name:<font color='0000ff' size=4>%-7.7s</font>"
-F "addr:<fonr color='ff0000'>%s</font>"
"select * from test where ..."
2. Snapshot cursor operation.
exec_sql -c cur "select * from test where ..."
exec_sql "open cur"
exec_sql "fetch in cur into :r1, :r2"
echo "r1=$r1 r2=$r2"
exec_sql "close cur"
# Declare cursor operation is already implemented.
> I'm a little boried to enclose SQL statements
> into double quotes. Is't really need ?
I think that it is necessary, because in the inside of the
double quotes, it can be used $variable and it is possible to
describe the SQL statement in the multiple line.
ex) exec_sql "select * from test
where name='$DATA' and
addr='$ADATA'"
> I'm doubt it's possible, because
> SQL statement must begins from valid SQL word.
>
> If it's impossible to avoid probably pgbash
> might have a possibility to redefine quote character,
> so user could use
> exec_sql [select * from test]
> Notice, no need to press shift key !
> I think with a little more effort this could be
> achieved without explicit redefining of
> quote character. But this is not a big problem,
> I could use alias to define [] as a quote characters
> just as an example:
> alias sql='exec_sql -Q "[]"'
> and then use sql instead of exec_sql.
>
I use alias too, but I do not know the method for aliasing
double quotes.
ex)
alias E='exec_sql'
(Shell program)
-----------------------------------------------------
#!/usr/local/bin/bash
function E { exec_sql "$@" }
-----------------------------------------------------
(KUBO Takehiro taught me this method.)
> Anyway, I'm just speculating about enhancement
> after playing for several hours with pgbash.
> I like it !
I hope a new idea.
--
Regards.
SAKAIDA Masaaki -- Osaka, Japan
# Sorry, I am not good at English.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: sakaida@psn.co.jp, oleg@sai.msu.su, pgsql-hackers@postgreSQL.org
Subject: Re: [HACKERS] pgbash-1.1.1 release
In-Reply-To: <37F57E83118.743FSAKAIDA@smtp.psn.ne.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox