<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars" -->

---
title: All Your GUCs in a Row: file_copy_method | daily.dev
description: PostgreSQL 18 introduces the `file_copy_method` GUC with a `clone` option that leverages copy-on-write filesystem reflinks to make `CREATE DATABASE` nearly...
canonical: https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: All Your GUCs in a Row: file_copy_method | daily.dev
og:description: PostgreSQL 18 introduces the `file_copy_method` GUC with a `clone` option that leverages copy-on-write filesystem reflinks to make `CREATE DATABASE` nearly...
og:url: https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars
og:image: https://api.daily.dev/og/posts/pLrDeOaRs.png
og:image:alt: All Your GUCs in a Row: file_copy_method
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# All Your GUCs in a Row: file_copy_method

**[Planet PostgreSQL](https://daily.dev/sources/planet-postgresql)** · 3 min read · 1 upvotes · 0 comments

## Summary

PostgreSQL 18 introduces the `file_copy_method` GUC with a `clone` option that leverages copy-on-write filesystem reflinks to make `CREATE DATABASE` nearly instantaneous regardless of database size. On supported filesystems (XFS with reflinks, Btrfs, ZFS, APFS), cloning a 120 GB database takes ~200ms and an 800 GB one under a second. Three preconditions must all be met: a COW-capable filesystem, explicitly requesting `STRATEGY = FILE_COPY`, and no active sessions on the template database. The default `copy` setting does a full byte-for-byte duplication, while `clone` only writes metadata pointers. This makes per-branch and per-developer throwaway databases practical. On non-COW filesystems like ext4, `clone` fails rather than falling back silently.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://postgr.es/p/9q4>

## Questions this post answers

### What does file_copy_method = clone do in PostgreSQL 18?

It changes CREATE DATABASE (with STRATEGY = FILE_COPY) and ALTER DATABASE ... SET TABLESPACE to use OS-level reflinking instead of a byte-for-byte copy, calling copy_file_range() on Linux or copyfile() on macOS. On copy-on-write filesystems this shares blocks via metadata pointers rather than duplicating data, making the copy nearly instant regardless of database size.

_daily.dev surfaces practical PostgreSQL tuning changes like this for engineers optimizing database provisioning workflows._

### Which filesystems support PostgreSQL's file_copy_method clone setting?

It requires a copy-on-write filesystem: XFS with reflinks enabled (the default in modern XFS), Btrfs, ZFS, or APFS. On ext4 there is no reflink support, so clone fails outright rather than silently falling back to a regular copy, which matters inside container images that default to ext4.

_Teams choosing storage backends for PostgreSQL can track filesystem compatibility notes like this via daily.dev._

### How fast is cloning a PostgreSQL database with file_copy_method = clone versus a regular copy?

Cloning a 120GB database takes around 200 milliseconds and an 800GB database just over half a second, since copy-on-write reflinking only writes new metadata pointers rather than moving data. This makes CREATE DATABASE near-instant on supported filesystems, compared to the default copy method, which duplicates every byte and scales with database size.

_daily.dev helps engineers weighing database provisioning speed keep up with PostgreSQL performance changes like this._

## Similar posts on daily.dev

- [3 Hours to 7 Minutes: Fixing Aurora PostgreSQL’s Silent CREATE DATABASE Regression](https://daily.dev/posts/3-hours-to-7-minutes-fixing-aurora-postgresql-s-silent-create-database-regression-ea1iig0ij) · Medium · 0 upvotes · 0 comments
- [All Your GUCs in a Row: file\_extend\_method](https://daily.dev/posts/all-your-gucs-in-a-row-file-extend-method-2xigzvfm6) · Planet PostgreSQL · 1 upvotes · 1 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"All Your GUCs in a Row: file_copy_method","url":"https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars"},"datePublished":"2026-07-21T01:05:35.091Z","dateModified":"2026-09-13T20:54:35.578Z","description":"PostgreSQL 18 introduces the `file_copy_method` GUC with a `clone` option that leverages copy-on-write filesystem reflinks to make `CREATE DATABASE` nearly...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cc492a393909b40f5641e6bf814a7729?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cc492a393909b40f5641e6bf814a7729?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet PostgreSQL","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet PostgreSQL","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/planet-postgresql"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet PostgreSQL","item":"https://daily.dev/sources/planet-postgresql"},{"@type":"ListItem","position":3,"name":"All Your GUCs in a Row: file_copy_method"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/all-your-gucs-in-a-row-file-copy-method-plrdeoars#faq","mainEntity":[{"@type":"Question","name":"What does file_copy_method = clone do in PostgreSQL 18?","acceptedAnswer":{"@type":"Answer","text":"It changes CREATE DATABASE (with STRATEGY = FILE_COPY) and ALTER DATABASE ... SET TABLESPACE to use OS-level reflinking instead of a byte-for-byte copy, calling copy_file_range() on Linux or copyfile() on macOS. On copy-on-write filesystems this shares blocks via metadata pointers rather than duplicating data, making the copy nearly instant regardless of database size. daily.dev surfaces practical PostgreSQL tuning changes like this for engineers optimizing database provisioning workflows."}},{"@type":"Question","name":"Which filesystems support PostgreSQL's file_copy_method clone setting?","acceptedAnswer":{"@type":"Answer","text":"It requires a copy-on-write filesystem: XFS with reflinks enabled (the default in modern XFS), Btrfs, ZFS, or APFS. On ext4 there is no reflink support, so clone fails outright rather than silently falling back to a regular copy, which matters inside container images that default to ext4. Teams choosing storage backends for PostgreSQL can track filesystem compatibility notes like this via daily.dev."}},{"@type":"Question","name":"How fast is cloning a PostgreSQL database with file_copy_method = clone versus a regular copy?","acceptedAnswer":{"@type":"Answer","text":"Cloning a 120GB database takes around 200 milliseconds and an 800GB database just over half a second, since copy-on-write reflinking only writes new metadata pointers rather than moving data. This makes CREATE DATABASE near-instant on supported filesystems, compared to the default copy method, which duplicates every byte and scales with database size. daily.dev helps engineers weighing database provisioning speed keep up with PostgreSQL performance changes like this."}}]}
```

