{
    "mode": "man",
    "parameter": "REFRESH_MATERIALIZED_VIEW",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/REFRESH_MATERIALIZED_VIEW/7/json",
    "generated": "2026-05-30T07:11:41Z",
    "synopsis": "REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] name\n[ WITH [ NO ] DATA ]",
    "sections": {
        "NAME": {
            "content": "REFRESHMATERIALIZEDVIEW - replace the contents of a materialized view\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] name\n[ WITH [ NO ] DATA ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "REFRESH MATERIALIZED VIEW completely replaces the contents of a materialized view. To execute\nthis command you must be the owner of the materialized view. The old contents are discarded.\nIf WITH DATA is specified (or defaults) the backing query is executed to provide the new\ndata, and the materialized view is left in a scannable state. If WITH NO DATA is specified no\nnew data is generated and the materialized view is left in an unscannable state.\n\nCONCURRENTLY and WITH NO DATA may not be specified together.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "CONCURRENTLY\nRefresh the materialized view without locking out concurrent selects on the materialized\nview. Without this option a refresh which affects a lot of rows will tend to use fewer\nresources and complete more quickly, but could block other connections which are trying\nto read from the materialized view. This option may be faster in cases where a small\nnumber of rows are affected.\n\nThis option is only allowed if there is at least one UNIQUE index on the materialized\nview which uses only column names and includes all rows; that is, it must not be an\nexpression index or include a WHERE clause.\n\nThis option may not be used when the materialized view is not already populated.\n\nEven with this option only one REFRESH at a time may run against any one materialized\nview.\n\nname\nThe name (optionally schema-qualified) of the materialized view to refresh.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "If there is an ORDER BY clause in the materialized view's defining query, the original\ncontents of the materialized view will be ordered that way; but REFRESH MATERIALIZED VIEW\ndoes not guarantee to preserve that ordering.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "This command will replace the contents of the materialized view called ordersummary using\nthe query from the materialized view's definition, and leave it in a scannable state:\n\nREFRESH MATERIALIZED VIEW ordersummary;\n\nThis command will free storage associated with the materialized view annualstatisticsbasis\nand leave it in an unscannable state:\n\nREFRESH MATERIALIZED VIEW annualstatisticsbasis WITH NO DATA;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "REFRESH MATERIALIZED VIEW is a PostgreSQL extension.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE MATERIALIZED VIEW (CREATEMATERIALIZEDVIEW(7)), ALTER MATERIALIZED VIEW\n(ALTERMATERIALIZEDVIEW(7)), DROP MATERIALIZED VIEW (DROPMATERIALIZEDVIEW(7))\n\n\n\nPostgreSQL 14.23                                2026                    REFRESH MATERIALIZED VIEW(7)",
            "subsections": []
        }
    },
    "summary": "REFRESHMATERIALIZEDVIEW - replace the contents of a materialized view",
    "flags": [],
    "examples": [
        "This command will replace the contents of the materialized view called ordersummary using",
        "the query from the materialized view's definition, and leave it in a scannable state:",
        "REFRESH MATERIALIZED VIEW ordersummary;",
        "This command will free storage associated with the materialized view annualstatisticsbasis",
        "and leave it in an unscannable state:",
        "REFRESH MATERIALIZED VIEW annualstatisticsbasis WITH NO DATA;"
    ],
    "see_also": [
        {
            "name": "CREATEMATERIALIZEDVIEW",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATEMATERIALIZEDVIEW/7/json"
        },
        {
            "name": "ALTERMATERIALIZEDVIEW",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERMATERIALIZEDVIEW/7/json"
        },
        {
            "name": "DROPMATERIALIZEDVIEW",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPMATERIALIZEDVIEW/7/json"
        },
        {
            "name": "VIEW",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/VIEW/7/json"
        }
    ]
}