Hi,
> The pgAdmin source base is peppered with references to a non-existent
> "proargdefvals" attribute.
Ok, this was being used in AS83, so we cannot remove these references
completely.
> The FEATURE_FUNCTION_DEFAULTS feature will not get set because of this
> ever. This patch replaces the references to this attribute by the valid
> "proargdefaults" attribute.
>
>
PFA, a revised patch which now checks for version number apropriately. The
problem seems to be only with procedures/functions belonging to packages in
the code.
Regards,
Nikhils
diff --git a/pgadmin/db/pgConn.cpp b/pgadmin/db/pgConn.cpp
index 5589b89..a40782b 100644
--- a/pgadmin/db/pgConn.cpp
+++ b/pgadmin/db/pgConn.cpp
@@ -517,7 +517,9 @@ bool pgConn::HasFeature(int featureNo, bool forceCheck)
}
// Check for EDB function parameter default support
- wxString hasFuncDefs = ExecuteScalar(wxT("SELECT count(*) FROM pg_attribute WHERE attrelid = 'pg_catalog.pg_proc'::regclass AND attname = 'proargdefvals'"));
+ wxString defCol = EdbMinimumVersion(8, 4) ? wxT("'proargdefaults'") : wxT("'proargdefvals'");
+
+ wxString hasFuncDefs = ExecuteScalar(wxT("SELECT count(*) FROM pg_attribute WHERE attrelid = 'pg_catalog.pg_proc'::regclass AND attname = ") + defCol);
if (hasFuncDefs == wxT("1"))
features[FEATURE_FUNCTION_DEFAULTS] = true;
else
diff --git a/pgadmin/schema/edbPackageFunction.cpp b/pgadmin/schema/edbPackageFunction.cpp
index ed0b692..49faae7 100644
--- a/pgadmin/schema/edbPackageFunction.cpp
+++ b/pgadmin/schema/edbPackageFunction.cpp
@@ -189,7 +189,10 @@ edbPackageFunction *edbPackageFunctionFactory::AppendFunctions(pgObject *obj, ed
wxString sql, argDefsCol;
if (obj->GetConnection()->HasFeature(FEATURE_FUNCTION_DEFAULTS))
- argDefsCol = wxT("proargdefvals, ");
+ {
+ argDefsCol = obj->GetConnection()->EdbMinimumVersion(8, 4) ? wxT("proargdefaults") : wxT("proargdefvals");
+ argDefsCol += wxT(" AS argdefaults, ");
+ }
if (obj->GetConnection()->EdbMinimumVersion(8, 2))
{
@@ -259,7 +262,8 @@ edbPackageFunction *edbPackageFunctionFactory::AppendFunctions(pgObject *obj, ed
// Function defaults
if (obj->GetConnection()->HasFeature(FEATURE_FUNCTION_DEFAULTS))
{
- tmp = packageFunctions->GetVal(wxT("proargdefvals"));
+ tmp = packageFunctions->GetVal(wxT("argdefaults"));
+
if (!tmp.IsEmpty())
argDefsTkz.SetString(tmp.Mid(1, tmp.Length() - 2), wxT(","));
}
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers