pgtclutils.tcl

来自「关系型数据库 Postgresql 6.5.2」· TCL 代码 · 共 17 行

TCL
17
字号
# getDBs :#   get the names of all the databases at a given host and port number#   with the defaults being the localhost and port 5432#   return them in alphabetical orderproc getDBs { {host "localhost"} {port "5432"} } {    # datnames is the list to be result    set conn [pg_connect template1 -host $host -port $port]    set res [pg_exec $conn "SELECT datname FROM pg_database ORDER BY datname"]    set ntups [pg_result $res -numTuples]    for {set i 0} {$i < $ntups} {incr i} {	lappend datnames [pg_result $res -getTuple $i]    }    pg_disconnect $conn    return $datnames}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?