Hi,

If one clicks on Postgres (non EDB) database and tries to expand the schema
tab, then the current git head spits out an error. The offending query
contains the following comparison

protype = 1;

protype is of type char, so it expects the RHS to be a char. However this
works ok against an EDB database. Anyways, the fix is to compare protype
with '1'. This sql works fine on both flavours of databases. Fixing this at
all relevant locations.

Regards,
Nikhils
diff --git a/pgadmin/schema/pgFunction.cpp b/pgadmin/schema/pgFunction.cpp
index 7102be9..82d3557 100644
--- a/pgadmin/schema/pgFunction.cpp
+++ b/pgadmin/schema/pgFunction.cpp
@@ -958,7 +958,7 @@ pgObject *pgFunctionFactory::CreateObjects(pgCollection *collection, ctlTree *br
 	                           + wxT("::oid\n   AND typname <> 'trigger'\n");
 
 	if (collection->GetConnection()->EdbMinimumVersion(8, 1))
-		funcRestriction += wxT("   AND NOT (lanname = 'edbspl' AND protype = 1)\n");
+		funcRestriction += wxT("   AND NOT (lanname = 'edbspl' AND protype = '1')\n");
 	else if (collection->GetConnection()->EdbMinimumVersion(8, 0))
 		funcRestriction += wxT("   AND NOT (lanname = 'edbspl' AND typname = 'void')\n");
 
@@ -991,7 +991,7 @@ pgObject *pgProcedureFactory::CreateObjects(pgCollection *collection, ctlTree *b
 	                           + wxT("::oid AND lanname = 'edbspl'\n");
 
 	if (collection->GetConnection()->EdbMinimumVersion(8, 1))
-		funcRestriction += wxT("   AND protype = 1\n");
+		funcRestriction += wxT("   AND protype = '1'\n");
 	else
 		funcRestriction += wxT("   AND typname = 'void'\n");
 
-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to