Re: [HACKERS] pgbash-1.1.1 release - Mailing list pgsql-hackers

From SAKAIDA
Subject Re: [HACKERS] pgbash-1.1.1 release
Date
Msg-id 37F5837182.7440SAKAIDA@smtp.psn.ne.jp
Whole thread Raw
In response to Re: [HACKERS] pgbash-1.1.1 release  (SAKAIDA Masaaki <sakaida@psn.co.jp>)
List pgsql-hackers
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:<TDoption4>"           -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
incur 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. 



pgsql-hackers by date:

Previous
From: SAKAIDA
Date:
Subject: Re: [HACKERS] pgbash-1.1.1 release
Next
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: [HACKERS] postmaster dead on startup from unportable SSL patch