{
    "mode": "man",
    "parameter": "MOVE",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/MOVE/7/json",
    "generated": "2026-06-16T00:37:28Z",
    "synopsis": "MOVE [ direction ] [ FROM | IN ] cursorname\nwhere direction can be one of:\nNEXT\nPRIOR\nFIRST\nLAST\nABSOLUTE count\nRELATIVE count\ncount\nALL\nFORWARD\nFORWARD count\nFORWARD ALL\nBACKWARD\nBACKWARD count\nBACKWARD ALL",
    "sections": {
        "NAME": {
            "content": "MOVE - position a cursor\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "MOVE [ direction ] [ FROM | IN ] cursorname\n\nwhere direction can be one of:\n\nNEXT\nPRIOR\nFIRST\nLAST\nABSOLUTE count\nRELATIVE count\ncount\nALL\nFORWARD\nFORWARD count\nFORWARD ALL\nBACKWARD\nBACKWARD count\nBACKWARD ALL\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "MOVE repositions a cursor without retrieving any data.  MOVE works exactly like the FETCH\ncommand, except it only positions the cursor and does not return rows.\n\nThe parameters for the MOVE command are identical to those of the FETCH command; refer to\nFETCH(7) for details on syntax and usage.\n",
            "subsections": []
        },
        "OUTPUTS": {
            "content": "On successful completion, a MOVE command returns a command tag of the form\n\nMOVE count\n\nThe count is the number of rows that a FETCH command with the same parameters would have\nreturned (possibly zero).\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "BEGIN WORK;\nDECLARE liahona CURSOR FOR SELECT * FROM films;\n\n-- Skip the first 5 rows:\nMOVE FORWARD 5 IN liahona;\nMOVE 5\n\n-- Fetch the 6th row from the cursor liahona:\nFETCH 1 FROM liahona;\ncode  | title  | did | dateprod  |  kind  |  len\n-------+--------+-----+------------+--------+-------\nP303 | 48 Hrs | 103 | 1982-10-22 | Action | 01:37\n(1 row)\n\n-- Close the cursor liahona and end the transaction:\nCLOSE liahona;\nCOMMIT WORK;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "There is no MOVE statement in the SQL standard.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CLOSE(7), DECLARE(7), FETCH(7)\n\n\n\nPostgreSQL 14.23                                2026                                         MOVE(7)",
            "subsections": []
        }
    },
    "summary": "MOVE - position a cursor",
    "flags": [],
    "examples": [
        "BEGIN WORK;",
        "DECLARE liahona CURSOR FOR SELECT * FROM films;",
        "-- Skip the first 5 rows:",
        "MOVE FORWARD 5 IN liahona;",
        "MOVE 5",
        "-- Fetch the 6th row from the cursor liahona:",
        "FETCH 1 FROM liahona;",
        "code  | title  | did | dateprod  |  kind  |  len",
        "-------+--------+-----+------------+--------+-------",
        "P303 | 48 Hrs | 103 | 1982-10-22 | Action | 01:37",
        "(1 row)",
        "-- Close the cursor liahona and end the transaction:",
        "CLOSE liahona;",
        "COMMIT WORK;"
    ],
    "see_also": [
        {
            "name": "CLOSE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CLOSE/7/json"
        },
        {
            "name": "DECLARE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DECLARE/7/json"
        },
        {
            "name": "FETCH",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/FETCH/7/json"
        }
    ]
}