If it helps, I also see that error with PostgreSQL. Using your hello script, I get:
[24/Apr/2003:19:45:38][1288.1416][-conn:openacs4::0] Error: invalid database id: "nsdb0"
invalid database id: "nsdb0"
while executing
"ns_db poolname $handle"
(procedure "db_driverkey" line 7)
invoked from within
"db_driverkey -handle_p 1 $db"
(procedure "db_exec" line 3)
invoked from within
"db_exec 0or1row $db $full_statement_name $sql"
invoked from within
"set selection [db_exec 0or1row $db $full_statement_name $sql]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
set selection [db_exec 0or1row $db $full_statement_name $sql]
}"
(procedure "db_0or1row" line 23)
invoked from within
"db_0or1row select_permission_p {}"
(procedure "permission::permission_p_not_cached" line 6)
invoked from within
"permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege"
(procedure "permission_p" line 8)
invoked from within
"permission_p -party_id $party_id -object_id $object_id -privilege $privilege"
(procedure "permission::require_permission" line 7)
invoked from within
"permission::require_permission -object_id [ad_conn object_id] -privilege read"
invoked from within
"if {[string match "admin/*" [ad_conn extra_url]]} {
permission::require_permission -object_id [ad_conn object_id] -privilege admin
} else..."
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
if {[string match "admin/*" [ad_conn extra_url]]} {
permission::require_permission -object_id [ad_conn object_id] -privilege adm..."
(procedure "rp_filter" line 162)
invoked from within
"rp_filter preauth"