summaryrefslogtreecommitdiff
path: root/includes/database.pgsql.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/database.pgsql.inc')
-rw-r--r--includes/database.pgsql.inc21
1 files changed, 3 insertions, 18 deletions
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index e63f00b9d..c5fd4401b 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -208,20 +208,6 @@ function db_fetch_array($result) {
}
/**
- * Determine how many result rows were found by the preceding query.
- *
- * @param $result
- * A database query result resource, as returned from db_query().
- * @return
- * The number of result rows.
- */
-function db_num_rows($result) {
- if ($result) {
- return pg_num_rows($result);
- }
-}
-
-/**
* Return an individual result field from the previous query.
*
* Only use this function if exactly one field is being selected; otherwise,
@@ -323,9 +309,8 @@ function db_query_range($query) {
* so that they can be properly escaped to avoid SQL injection attacks.
*
* Note that if you need to know how many results were returned, you should do
- * a SELECT COUNT(*) on the temporary table afterwards. db_num_rows() and
- * db_affected_rows() do not give consistent result across different database
- * types in this case.
+ * a SELECT COUNT(*) on the temporary table afterwards. db_affected_rows() does
+ * not give consistent result across different database types in this case.
*
* @param $query
* A string containing a normal SELECT SQL query.
@@ -414,7 +399,7 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
- return db_num_rows(db_query("SELECT relname FROM pg_class WHERE relname = '{". db_escape_table($table) ."}'"));
+ return db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '{". db_escape_table($table) ."}'"));
}
/**