X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B47DCD1EC44 for ; Tue, 23 Mar 2004 22:37:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 61004-04 for ; Tue, 23 Mar 2004 18:37:22 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id AE475D1E414 for ; Tue, 23 Mar 2004 18:37:19 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i2NMbAo6007254; Tue, 23 Mar 2004 17:37:11 -0500 (EST) To: Chester Kustarz Cc: pgsql-sql@postgresql.org Subject: Re: move forward 0 from foo; In-reply-to: References: Comments: In-reply-to Chester Kustarz message dated "Tue, 23 Mar 2004 16:13:39 -0500" Date: Tue, 23 Mar 2004 17:37:10 -0500 Message-ID: <7253.1080081430@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/242 X-Sequence-Number: 17341 Chester Kustarz writes: > I expected "MOVE FORWARD 0 FROM foo;" to always return > 0, but I have found this not to be the case. You are misinterpreting the output. The result is the number of rows that would have been returned by a FETCH with the same parameters. FETCH 0 means "re-fetch current row" (don't blame us, this is per SQL spec), and so it will return 1 row unless you are currently positioned off the end of the result. Hence, MOVE 0 returns either 0 or 1 depending on whether you are currently on a row. It looks like the MOVE documentation is a bit poorly worded; I'll do something about that. regards, tom lane