summaryrefslogtreecommitdiff
path: root/contrib/dbsize/dbsize.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dbsize/dbsize.c')
-rw-r--r--contrib/dbsize/dbsize.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/dbsize/dbsize.c b/contrib/dbsize/dbsize.c
index d85822914df..b072a86912f 100644
--- a/contrib/dbsize/dbsize.c
+++ b/contrib/dbsize/dbsize.c
@@ -59,8 +59,8 @@ database_size(PG_FUNCTION_ARGS)
relation = heap_openr(DatabaseRelationName, AccessShareLock);
ScanKeyEntryInitialize(&scanKey, 0, Anum_pg_database_datname,
F_NAMEEQ, NameGetDatum(dbname));
- scan = heap_beginscan(relation, 0, SnapshotNow, 1, &scanKey);
- tuple = heap_getnext(scan, 0);
+ scan = heap_beginscan(relation, SnapshotNow, 1, &scanKey);
+ tuple = heap_getnext(scan, ForwardScanDirection);
if (!HeapTupleIsValid(tuple))
elog(ERROR, "database %s does not exist", NameStr(*dbname));