diff --git a/pgadmin/debugger/dbgPgThread.cpp b/pgadmin/debugger/dbgPgThread.cpp
index e7ffaf3..f01f29c 100644
--- a/pgadmin/debugger/dbgPgThread.cpp
+++ b/pgadmin/debugger/dbgPgThread.cpp
@@ -119,11 +119,16 @@ void *dbgPgThread::Entry( void )
 #if defined (__WXMSW__) || (EDB_LIBPQ)
 		// If we have a set of params, and we have the required functions...
 		dbgPgParams *params = m_currentCommand->getParams();
+		bool		 doit = true;
+
+		// we do not need all of PQi stuff AS90 onwards
+		if (m_owner.EdbMinimumVersion(9, 0))
+			doit = false;
 
 #ifdef EDB_LIBPQ
-		if (params)
+		if (params && doit)
 #else
-		if (PQiGetOutResult && PQiPrepareOut && PQiSendQueryPreparedOut && params)
+		if (PQiGetOutResult && PQiPrepareOut && PQiSendQueryPreparedOut && params && doit)
 #endif
 		{
 			wxLogInfo(wxT("Using an EnterpriseDB callable statement"));
diff --git a/pgadmin/debugger/dbgTargetInfo.cpp b/pgadmin/debugger/dbgTargetInfo.cpp
index 14cb871..8c9b937 100644
--- a/pgadmin/debugger/dbgTargetInfo.cpp
+++ b/pgadmin/debugger/dbgTargetInfo.cpp
@@ -150,7 +150,11 @@ dbgTargetInfo::dbgTargetInfo( const wxString &target,  dbgPgConn *conn, char tar
 		// store the "" only if this is stringlike type and nothing otherwise..
 		defVal = (defvals.GetNextToken()).Strip ( wxString::both );
 		if (argInfo.isValidDefVal(defVal))
+		{
+			// remove starting/trailing quotes
+			defVal.Replace( wxT( "\"" ), wxT( "" ));
 			argInfo.setValue(defVal);
+		}
 
 		m_argInfo.Add( argInfo );
 	}
diff --git a/pgadmin/debugger/debugger.cpp b/pgadmin/debugger/debugger.cpp
index a6b55fb..74c584c 100644
--- a/pgadmin/debugger/debugger.cpp
+++ b/pgadmin/debugger/debugger.cpp
@@ -138,6 +138,7 @@ bool debuggerFactory::CheckEnable(pgObject *obj)
 #ifdef __WXMSW__
 					else if (func->GetLanguage() == wxT("edbspl") &&
 					         obj->GetConnection()->EdbMinimumVersion(8, 4) &&
+					         !obj->GetConnection()->EdbMinimumVersion(9, 0) &&
 					         !(PQiGetOutResult && PQiPrepareOut && PQiSendQueryPreparedOut))
 						return false;
 #else
diff --git a/pgadmin/debugger/dlgDirectDbg.cpp b/pgadmin/debugger/dlgDirectDbg.cpp
index 8310abf..cdbd422 100644
--- a/pgadmin/debugger/dlgDirectDbg.cpp
+++ b/pgadmin/debugger/dlgDirectDbg.cpp
@@ -547,7 +547,8 @@ void dlgDirectDbg::invokeTarget()
 	// us to retrieve the OUT/INOUT parameter results.
 	// Otherwise, just SELECT/EXEC it as per normal.
 #ifdef __WXMSW__
-	if (!m_targetInfo->getIsFunction() &&
+	if (!m_conn->EdbMinimumVersion(9,0) &&
+			!m_targetInfo->getIsFunction() &&
 	        PQiGetOutResult &&
 	        PQiPrepareOut &&
 	        PQiSendQueryPreparedOut)
@@ -555,7 +556,8 @@ void dlgDirectDbg::invokeTarget()
 	else
 #else
 #ifdef EDB_LIBPQ
-	if (!m_targetInfo->getIsFunction())
+	if (!m_conn->EdbMinimumVersion(9,0) &&
+			!m_targetInfo->getIsFunction())
 		invokeTargetCallable();
 	else
 #endif
@@ -690,17 +692,30 @@ void dlgDirectDbg::invokeTargetStatement()
 				wxString strParam = wxString::Format(wxT("param%d"), i);
 				declareStatement +=  strParam + wxT(" ") + arg.getType();
 				if (arg.getMode() == wxT("b"))
-					declareStatement += wxT(" := ") + arg.quoteValue() + wxT("::") + arg.getType();
+				{
+					declareStatement += wxT(" := ") + arg.quoteValue();
+					if (!arg.quoteValue().Contains(wxT("::")))
+						declareStatement += wxT("::") + arg.getType();
+				}
 				declareStatement += wxT(";\n");
 				query.Append(strParam + wxT(", "));
 			}
 			else if (arg.getMode() != wxT("o"))
-				query.Append( arg.quoteValue() + wxT("::") + arg.getType() + wxT(", "));
+			{
+				if (!arg.quoteValue().Contains(wxT("::")))
+					query.Append( arg.quoteValue() + wxT("::") + arg.getType() + wxT(", "));
+				else
+					query.Append( arg.quoteValue() + wxT(", "));
+			}
 		}
 		else if(arg.getMode() == wxT("v"))
 			query.Append( arg.getValue() + wxT(", "));
-		else
-			query.Append( arg.quoteValue() + wxT("::") + arg.getType() + wxT(", "));
+		else {
+			if (!arg.quoteValue().Contains(wxT("::")))
+				query.Append( arg.quoteValue() + wxT("::") + arg.getType() + wxT(", "));
+			else
+				query.Append( arg.quoteValue() + wxT(", "));
+		}
 	}
 
 	if (query.EndsWith(wxT(", ")))
diff --git a/pgadmin/schema/pgFunction.cpp b/pgadmin/schema/pgFunction.cpp
index 5676843..d490023 100644
--- a/pgadmin/schema/pgFunction.cpp
+++ b/pgadmin/schema/pgFunction.cpp
@@ -558,7 +558,8 @@ wxString pgFunction::GetArgSigList(const bool forScript)
 
 	for (unsigned int i = 0; i < argTypesArray.Count(); i++)
 	{
-		// OUT parameters are not considered part of the signature, except for EDB-SPL
+		// OUT parameters are not considered part of the signature, except for EDB-SPL,
+		// although this is not true for EDB AS90 onwards..
 		if (argModesArray.Item(i) != wxT("OUT") && argModesArray.Item(i) != wxT("TABLE"))
 		{
 			if (args.Length() > 0)
@@ -576,7 +577,8 @@ wxString pgFunction::GetArgSigList(const bool forScript)
 		}
 		else
 		{
-			if (GetLanguage() == wxT("edbspl") && argModesArray.Item(i) != wxT("TABLE"))
+			if (GetLanguage() == wxT("edbspl") && argModesArray.Item(i) != wxT("TABLE") &&
+									!this->GetConnection()->EdbMinimumVersion(9, 0))
 			{
 				if (args.Length() > 0)
 				{
@@ -733,10 +735,6 @@ pgFunction *pgFunctionFactory::AppendFunctions(pgObject *obj, pgSchema *schema,
 
 			while (argTypesTkz.HasMoreTokens())
 			{
-				// Add the arg type. This is a type oid, so
-				// look it up in the hashmap
-				type = argTypesTkz.GetNextToken();
-				function->iAddArgType(typeCache[type]);
 
 				// Now add the name, stripping the quotes and \" if
 				// necessary.
@@ -746,11 +744,37 @@ pgFunction *pgFunctionFactory::AppendFunctions(pgObject *obj, pgSchema *schema,
 					if (name[0] == '"')
 						name = name.Mid(1, name.Length() - 2);
 					name.Replace(wxT("\\\""), wxT("\""));
+
+					// In EDBAS 90, if an SPL-function has both an OUT-parameter
+					// and a return value (which is not possible on PostgreSQL otherwise),
+					// the return value is transformed into an extra OUT-parameter
+					// named "_retval_"
+					if (obj->GetConnection()->EdbMinimumVersion(9, 0))
+					{
+						if (name == wxT("_retval_"))
+						{
+							type = argTypesTkz.GetNextToken();
+							// this will be the return type for this object
+							function->iSetReturnType(typeCache[type]);
+
+							// consume uniformly, mode will definitely be "OUT"
+							mode = argModesTkz.GetNextToken();
+							// no defvals..
+							if (!hasDefValSupport)
+								def = argDefsTkz.GetNextToken();
+							continue;
+						}
+					}
 					function->iAddArgName(name);
 				}
 				else
 					function->iAddArgName(wxEmptyString);
 
+				// Add the arg type. This is a type oid, so
+				// look it up in the hashmap
+				type = argTypesTkz.GetNextToken();
+				function->iAddArgType(typeCache[type]);
+
 				// Now the mode
 				mode = argModesTkz.GetNextToken();
 				if (!mode.IsEmpty())
@@ -858,12 +882,17 @@ pgFunction *pgFunctionFactory::AppendFunctions(pgObject *obj, pgSchema *schema,
 
 			function->iSetOwner(functions->GetVal(wxT("funcowner")));
 			function->iSetAcl(functions->GetVal(wxT("proacl")));
-			wxString strType = functions->GetVal(wxT("typname"));
-			if (strType.Lower() == wxT("record") && !strReturnTableArgs.IsEmpty())
+
+			// set the return type only if not already set..
+			if (function->GetReturnType().IsEmpty())
 			{
-				strType = wxT("TABLE(") + strReturnTableArgs + wxT(")");
+				wxString strType = functions->GetVal(wxT("typname"));
+				if (strType.Lower() == wxT("record") && !strReturnTableArgs.IsEmpty())
+				{
+					strType = wxT("TABLE(") + strReturnTableArgs + wxT(")");
+				}
+				function->iSetReturnType(strType);
 			}
-			function->iSetReturnType(strType);
 			function->iSetComment(functions->GetVal(wxT("description")));
 
 			function->iSetLanguage(lanname);