db_get_dbhost (public)

 db_get_dbhost [ -dbn dbn ]

Defined in packages/acs-tcl/tcl/01-database-procs.tcl

PostgreSQL only.

Switches:
-dbn (optional)
The database name to use. If empty_string, uses the default database.
Returns:
the name of the database host from the first database pool. It assumes the datasource is properly formatted since we've already verified that we can connect to the pool.

Testcases:
No testcase defined.
Source code:
    set pool [lindex [db_available_pools $dbn] 0]
    set datasource [ns_config "ns/db/pool/$pool" DataSource]
    set first_colon_pos [string first ":" $datasource]
    if { $first_colon_pos == -1 } {
        ns_log Error "datasource contains no \":\"? datasource = $datasource"
        return ""
    }
    return [string range $datasource 0 $first_colon_pos-1]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: